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>\n<tr>"; } else { } echo "<td id='0'><div id=$v 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 git.master, git.master_jit, rfc.property-hooks
<table id='table1'> <tr><td class='mark'>id1</td><td class='mark'>id2</td><td class='mark'>id3</td><td class='mark'>id4</td><td class='mark'>id5</td><td class='mark'>id6</td><td class='mark'>id7</td><td class='mark'>id8</td></tr> <tr><td id='0'><div id=1 class='drag t1'>1</div></td><td id='0'><div id=2 class='drag t1'>2</div></td><td id='0'><div id=3 class='drag t1'>3</div></td><td id='0'><div id=4 class='drag t1'>4</div></td><td id='0'><div id=5 class='drag t1'>5</div></td><td id='0'><div id=6 class='drag t1'>6</div></td><td id='0'><div id=7 class='drag t1'>7</div></td><td id='0'><div id=8 class='drag t1'>8</div></td></tr> <tr><td class='mark'>id9</td><td class='mark'>id10</td><td class='mark'>id11</td><td class='mark'>id12</td><td class='mark'></td><td class='mark'></td><td class='mark'></td><td class='mark'></td></tr> <tr><td id='0'><div id=9 class='drag t1'>9</div></td><td id='0'><div id=10 class='drag t1'>10</div></td><td id='0'><div id=11 class='drag t1'>11</div></td><td id='0'><div id=12 class='drag t1'>12</div></td></tr> </table>

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
43.43 ms | 403 KiB | 8 Q