for ($j = 0; $j < ($syncCount <= 5 ? $syncCount : 5); $j++)
( , 5 )
for ($j = 0, $limit = min($syncCount, 5); $j < $limit; $j++)
Anothe nice solutions
foreach (range(0, min($syncCount, 5)) as $j)
Sidenote
$syncCount <= 5 ? $syncCount : 5 == min($syncCount, 5)