3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function math($x) { $results = $x * $x; return $results; } echo "<table border='1'> <tr> <th>Numbers</th> <th>result</th> </tr>"; for ($x=0; $x<=20; $x++) { echo "<tr>"; echo "<td>" . $x . " * " . $x . "</td>"; echo "<td>" . math($x) . "</td>"; echo "</tr>"; } echo "</table>"; ?>
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
<table border='1'> <tr> <th>Numbers</th> <th>result</th> </tr><tr><td>0 * 0</td><td>0</td></tr><tr><td>1 * 1</td><td>1</td></tr><tr><td>2 * 2</td><td>4</td></tr><tr><td>3 * 3</td><td>9</td></tr><tr><td>4 * 4</td><td>16</td></tr><tr><td>5 * 5</td><td>25</td></tr><tr><td>6 * 6</td><td>36</td></tr><tr><td>7 * 7</td><td>49</td></tr><tr><td>8 * 8</td><td>64</td></tr><tr><td>9 * 9</td><td>81</td></tr><tr><td>10 * 10</td><td>100</td></tr><tr><td>11 * 11</td><td>121</td></tr><tr><td>12 * 12</td><td>144</td></tr><tr><td>13 * 13</td><td>169</td></tr><tr><td>14 * 14</td><td>196</td></tr><tr><td>15 * 15</td><td>225</td></tr><tr><td>16 * 16</td><td>256</td></tr><tr><td>17 * 17</td><td>289</td></tr><tr><td>18 * 18</td><td>324</td></tr><tr><td>19 * 19</td><td>361</td></tr><tr><td>20 * 20</td><td>400</td></tr></table>