3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<!DOCTYPE html> <html> <head> <meta charset=utf-8 /> <title>JS Bin</title> <style type="text/css"> table.tb {border-collapse:collapse; width:100%; margin:0px 20px;} table.tb td {border:1px solid red; width:3%;} table.tb th {text-align:left; color:blue; } th span {margin-left:-20px;}; td input[type=checkbox]:checked + span {color:green;} </style> </head> <body> <?php error_reporting(0); $numRow=3; $numCol=18; $i=$j=1; echo "<table class=\"tb\">"; while($i<=$numRow) { echo "<tr>"; if ($i==1) { while($j<=$numCol) { $tIncrement=30*($j-1); $time=date("H:i",strtotime("08:00+ $tIncrement minute")); echo "<th><span>$time</span></th>"; $j++; } } else { while($j<=$numCol) { echo "<td><input type=\"checkbox\" name=\"slot\" ><span>slot</span></td>"; $j++; } } $j=1; echo "</tr>"; $i++; } echo "</table>"; ?> </body> </html>
Output for 4.3.0 - 5.0.5, 5.1.2 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
<!DOCTYPE html> <html> <head> <meta charset=utf-8 /> <title>JS Bin</title> <style type="text/css"> table.tb {border-collapse:collapse; width:100%; margin:0px 20px;} table.tb td {border:1px solid red; width:3%;} table.tb th {text-align:left; color:blue; } th span {margin-left:-20px;}; td input[type=checkbox]:checked + span {color:green;} </style> </head> <body> <table class="tb"><tr><th><span>08:00</span></th><th><span>08:30</span></th><th><span>09:00</span></th><th><span>09:30</span></th><th><span>10:00</span></th><th><span>10:30</span></th><th><span>11:00</span></th><th><span>11:30</span></th><th><span>12:00</span></th><th><span>12:30</span></th><th><span>13:00</span></th><th><span>13:30</span></th><th><span>14:00</span></th><th><span>14:30</span></th><th><span>15:00</span></th><th><span>15:30</span></th><th><span>16:00</span></th><th><span>16:30</span></th></tr><tr><td><input type="checkbox" name="slot" ><span>slot</span></td><td><input type="checkbox" name="slot" ><span>slot</span></td><td><input type="checkbox" name="slot" ><span>slot</span></td><td><input type="checkbox" name="slot" ><span>slot</span></td><td><input type="checkbox" name="slot" ><span>slot</span></td><td><input type="checkbox" name="slot" ><span>slot</span></td><td><input type="checkbox" name="slot" ><span>slot</span></td><td><input type="checkbox" name="slot" ><span>slot</span></td><td><input type="checkbox" name="slot" ><span>slot</span></td><td><input type="checkbox" name="slot" ><span>slot</span></td><td><input type="checkbox" name="slot" ><span>slot</span></td><td><input type="checkbox" name="slot" ><span>slot</span></td><td><input type="checkbox" name="slot" ><span>slot</span></td><td><input type="checkbox" name="slot" ><span>slot</span></td><td><input type="checkbox" name="slot" ><span>slot</span></td><td><input type="checkbox" name="slot" ><span>slot</span></td><td><input type="checkbox" name="slot" ><span>slot</span></td><td><input type="checkbox" name="slot" ><span>slot</span></td></tr><tr><td><input type="checkbox" name="slot" ><span>slot</span></td><td><input type="checkbox" name="slot" ><span>slot</span></td><td><input type="checkbox" name="slot" ><span>slot</span></td><td><input type="checkbox" name="slot" ><span>slot</span></td><td><input type="checkbox" name="slot" ><span>slot</span></td><td><input type="checkbox" name="slot" ><span>slot</span></td><td><input type="checkbox" name="slot" ><span>slot</span></td><td><input type="checkbox" name="slot" ><span>slot</span></td><td><input type="checkbox" name="slot" ><span>slot</span></td><td><input type="checkbox" name="slot" ><span>slot</span></td><td><input type="checkbox" name="slot" ><span>slot</span></td><td><input type="checkbox" name="slot" ><span>slot</span></td><td><input type="checkbox" name="slot" ><span>slot</span></td><td><input type="checkbox" name="slot" ><span>slot</span></td><td><input type="checkbox" name="slot" ><span>slot</span></td><td><input type="checkbox" name="slot" ><span>slot</span></td><td><input type="checkbox" name="slot" ><span>slot</span></td><td><input type="checkbox" name="slot" ><span>slot</span></td></tr></table></body> </html>
Output for 5.1.0 - 5.1.1
<!DOCTYPE html> <html> <head> <meta charset=utf-8 /> <title>JS Bin</title> <style type="text/css"> table.tb {border-collapse:collapse; width:100%; margin:0px 20px;} table.tb td {border:1px solid red; width:3%;} table.tb th {text-align:left; color:blue; } th span {margin-left:-20px;}; td input[type=checkbox]:checked + span {color:green;} </style> </head> <body> <table class="tb"><tr><th><span>01:00</span></th><th><span>01:00</span></th><th><span>01:00</span></th><th><span>01:00</span></th><th><span>01:00</span></th><th><span>01:00</span></th><th><span>01:00</span></th><th><span>01:00</span></th><th><span>01:00</span></th><th><span>01:00</span></th><th><span>01:00</span></th><th><span>01:00</span></th><th><span>01:00</span></th><th><span>01:00</span></th><th><span>01:00</span></th><th><span>01:00</span></th><th><span>01:00</span></th><th><span>01:00</span></th></tr><tr><td><input type="checkbox" name="slot" ><span>slot</span></td><td><input type="checkbox" name="slot" ><span>slot</span></td><td><input type="checkbox" name="slot" ><span>slot</span></td><td><input type="checkbox" name="slot" ><span>slot</span></td><td><input type="checkbox" name="slot" ><span>slot</span></td><td><input type="checkbox" name="slot" ><span>slot</span></td><td><input type="checkbox" name="slot" ><span>slot</span></td><td><input type="checkbox" name="slot" ><span>slot</span></td><td><input type="checkbox" name="slot" ><span>slot</span></td><td><input type="checkbox" name="slot" ><span>slot</span></td><td><input type="checkbox" name="slot" ><span>slot</span></td><td><input type="checkbox" name="slot" ><span>slot</span></td><td><input type="checkbox" name="slot" ><span>slot</span></td><td><input type="checkbox" name="slot" ><span>slot</span></td><td><input type="checkbox" name="slot" ><span>slot</span></td><td><input type="checkbox" name="slot" ><span>slot</span></td><td><input type="checkbox" name="slot" ><span>slot</span></td><td><input type="checkbox" name="slot" ><span>slot</span></td></tr><tr><td><input type="checkbox" name="slot" ><span>slot</span></td><td><input type="checkbox" name="slot" ><span>slot</span></td><td><input type="checkbox" name="slot" ><span>slot</span></td><td><input type="checkbox" name="slot" ><span>slot</span></td><td><input type="checkbox" name="slot" ><span>slot</span></td><td><input type="checkbox" name="slot" ><span>slot</span></td><td><input type="checkbox" name="slot" ><span>slot</span></td><td><input type="checkbox" name="slot" ><span>slot</span></td><td><input type="checkbox" name="slot" ><span>slot</span></td><td><input type="checkbox" name="slot" ><span>slot</span></td><td><input type="checkbox" name="slot" ><span>slot</span></td><td><input type="checkbox" name="slot" ><span>slot</span></td><td><input type="checkbox" name="slot" ><span>slot</span></td><td><input type="checkbox" name="slot" ><span>slot</span></td><td><input type="checkbox" name="slot" ><span>slot</span></td><td><input type="checkbox" name="slot" ><span>slot</span></td><td><input type="checkbox" name="slot" ><span>slot</span></td><td><input type="checkbox" name="slot" ><span>slot</span></td></tr></table></body> </html>