3v4l.org

run code in 300+ PHP versions simultaneously
<?php $rows = 10; $cols = 10; echo "<table border=\"1\">"; echo('<tr>'); for ($r =1; $r <= $cols; $r++){ echo("<td>.$r.</td>"); } echo('</tr>'); for($s = 1,$r=1;$s<=rows;$s++){ echo("<tr>"); if($r==1){ echo"<td>$s</td>"; } while($r<=10){ echo'<td>'.$s*$r++.'</td>'; } echo"</tr>"; $r=1;}
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.7
<table border="1"><tr><td>.1.</td><td>.2.</td><td>.3.</td><td>.4.</td><td>.5.</td><td>.6.</td><td>.7.</td><td>.8.</td><td>.9.</td><td>.10.</td></tr> Fatal error: Uncaught Error: Undefined constant "rows" in /in/YGSqF:11 Stack trace: #0 {main} thrown in /in/YGSqF on line 11
Process exited with code 255.
Output for 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33
<table border="1"><tr><td>.1.</td><td>.2.</td><td>.3.</td><td>.4.</td><td>.5.</td><td>.6.</td><td>.7.</td><td>.8.</td><td>.9.</td><td>.10.</td></tr> Warning: Use of undefined constant rows - assumed 'rows' (this will throw an Error in a future version of PHP) in /in/YGSqF on line 11
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.25
<table border="1"><tr><td>.1.</td><td>.2.</td><td>.3.</td><td>.4.</td><td>.5.</td><td>.6.</td><td>.7.</td><td>.8.</td><td>.9.</td><td>.10.</td></tr> Notice: Use of undefined constant rows - assumed 'rows' in /in/YGSqF on line 11

preferences:
179.54 ms | 402 KiB | 189 Q