3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php echo '<table>'; for ($i=0;$i<8;$i++) { echo '<tr>'; if($i==0 || $i==7) { for($j=0;$j<8;$j++) { ?> <td style="background: grey; height:10px; width:10px"></td> <?php } } else { for($j=0;$j<8;$j++) { if ($j==0 || $j==7) { ?> <td style="background: grey; height:10px; width:10px"></td> <?php } else { ?> <td style="background: white; height:10px; width:10px"></td> <?php } } } echo '</tr>'; } echo '</table>'; echo $i; echo $j ?>
Output for 4.3.0 - 7.2.0
<table><tr> <td style="background: grey; height:10px; width:10px"></td> <td style="background: grey; height:10px; width:10px"></td> <td style="background: grey; height:10px; width:10px"></td> <td style="background: grey; height:10px; width:10px"></td> <td style="background: grey; height:10px; width:10px"></td> <td style="background: grey; height:10px; width:10px"></td> <td style="background: grey; height:10px; width:10px"></td> <td style="background: grey; height:10px; width:10px"></td> </tr><tr> <td style="background: grey; height:10px; width:10px"></td> <td style="background: white; height:10px; width:10px"></td> <td style="background: white; height:10px; width:10px"></td> <td style="background: white; height:10px; width:10px"></td> <td style="background: white; height:10px; width:10px"></td> <td style="background: white; height:10px; width:10px"></td> <td style="background: white; height:10px; width:10px"></td> <td style="background: grey; height:10px; width:10px"></td> </tr><tr> <td style="background: grey; height:10px; width:10px"></td> <td style="background: white; height:10px; width:10px"></td> <td style="background: white; height:10px; width:10px"></td> <td style="background: white; height:10px; width:10px"></td> <td style="background: white; height:10px; width:10px"></td> <td style="background: white; height:10px; width:10px"></td> <td style="background: white; height:10px; width:10px"></td> <td style="background: grey; height:10px; width:10px"></td> </tr><tr> <td style="background: grey; height:10px; width:10px"></td> <td style="background: white; height:10px; width:10px"></td> <td style="background: white; height:10px; width:10px"></td> <td style="background: white; height:10px; width:10px"></td> <td style="background: white; height:10px; width:10px"></td> <td style="background: white; height:10px; width:10px"></td> <td style="background: white; height:10px; width:10px"></td> <td style="background: grey; height:10px; width:10px"></td> </tr><tr> <td style="background: grey; height:10px; width:10px"></td> <td style="background: white; height:10px; width:10px"></td> <td style="background: white; height:10px; width:10px"></td> <td style="background: white; height:10px; width:10px"></td> <td style="background: white; height:10px; width:10px"></td> <td style="background: white; height:10px; width:10px"></td> <td style="background: white; height:10px; width:10px"></td> <td style="background: grey; height:10px; width:10px"></td> </tr><tr> <td style="background: grey; height:10px; width:10px"></td> <td style="background: white; height:10px; width:10px"></td> <td style="background: white; height:10px; width:10px"></td> <td style="background: white; height:10px; width:10px"></td> <td style="background: white; height:10px; width:10px"></td> <td style="background: white; height:10px; width:10px"></td> <td style="background: white; height:10px; width:10px"></td> <td style="background: grey; height:10px; width:10px"></td> </tr><tr> <td style="background: grey; height:10px; width:10px"></td> <td style="background: white; height:10px; width:10px"></td> <td style="background: white; height:10px; width:10px"></td> <td style="background: white; height:10px; width:10px"></td> <td style="background: white; height:10px; width:10px"></td> <td style="background: white; height:10px; width:10px"></td> <td style="background: white; height:10px; width:10px"></td> <td style="background: grey; height:10px; width:10px"></td> </tr><tr> <td style="background: grey; height:10px; width:10px"></td> <td style="background: grey; height:10px; width:10px"></td> <td style="background: grey; height:10px; width:10px"></td> <td style="background: grey; height:10px; width:10px"></td> <td style="background: grey; height:10px; width:10px"></td> <td style="background: grey; height:10px; width:10px"></td> <td style="background: grey; height:10px; width:10px"></td> <td style="background: grey; height:10px; width:10px"></td> </tr></table>88