Jeff Samardzija struck out six over six innings to win for the fourth time in five starts, Jarrett Parker hit a two-run double, and the San Francisco Giants beat the Philadelphia Phillies 5-4 on Thursday night.