3v4l.org

run code in 300+ PHP versions simultaneously
<?php $result=range(1,5); $left=count($result); $colLeft=4; $limit=0; $i=0; foreach($result as $row) { echo if($i==0) { $limit=ceil($left/$colLeft); echo '<ul>'; } echo '<li>'.$row.'</li>'; $i++; $left--; if($i>=$limit) { echo '</ul>'; $i=0; $colLeft--; } }
Output for 5.4.0 - 5.4.30
Parse error: syntax error, unexpected 'if' (T_IF) in /in/sT8dL on line 10
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected T_IF in /in/sT8dL on line 10
Process exited with code 255.

preferences:
178.43 ms | 1395 KiB | 67 Q