3v4l.org

run code in 300+ PHP versions simultaneously
<?php $id= array("1","2","3","4","5","6","7","8","9","10","11","12"); $maxcols = 8; $i = 0;$j=0;$t=0;$s=0; $maxid = count($id); echo "<table id='table1'>\n<tr>"; foreach ($id as $k => $v) { if($t == 0) { while ($t <= $maxcols-1) { if($s < $maxid) { $s++;$t++; echo "<td class='mark'>id$s</td>"; } else { echo "<td class='mark'></td>";$t++;$s++; } } echo "</tr><tr>"; } else { } echo "<td id='0'><div id='{$k+1}' class='drag t1'>{$v}</div></td>"; $i++; if ($i == $maxcols) { echo "</tr>\n<tr>"; if($j == 0) { while ($j <= $maxcols-1) { if($s < $maxid) { $s++;$j++; echo "<td class='mark'>id$s</td>"; } else { echo "<td class='mark'></td>";$j++;$s++; } } echo "</tr>\n<tr>"; } $i=0; } } echo "</tr>\n</table>"; ?>
Output for 5.3.0 - 5.3.28, 5.4.0 - 5.4.26
Parse error: syntax error, unexpected '+', expecting '}' in /in/8VYPF on line 33
Process exited with code 255.

preferences:
182.8 ms | 1395 KiB | 63 Q