You are most probably using a php version older than 5.3.
from version 5.3, php allows to use the ternary operator, i.e.:
(expr1) ? (expr2) : (expr3)
in a new format.
Since PHP 5.3, it is possible to leave out the middle part of the ternary operator. Expression expr1 ?: expr3 returns expr1 if expr1 evaluates to TRUE, and expr3 otherwise.
database-sync.php uses this new style. so you either neeed to upgrade your php or you should edit this file and change those lines to:
(expr1) ? (expr1) : (expr3)