3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = 12; $b = 2; if ($b == 0) echo "b is zero\n"; else echo "<td>" . $a / $b . "</td>\n"; $b = 0; if ($b == 0) echo "b is zero\n"; else echo "<td>" . $a / $b . "</td>\n"; $b = "blah"; if ($b == 0) echo "b is zero\n"; else echo "<td>" . $a / $b . "</td>\n"; $b = "12blah"; if ($b == 0) echo "b is zero\n"; else echo "<td>" . $a / $b . "</td>\n"; $b = 1e-999; if ($b == 0) echo "b is zero\n"; else echo "<td>" . $a / $b . "</td>\n"; $b = false; if ($b == 0) echo "b is zero\n"; else echo "<td>" . $a / $b . "</td>\n"; $b = null; if ($b == 0) echo "b is zero\n"; else echo "<td>" . $a / $b . "</td>\n"; $b = array(); if ($b == 0) echo "b is zero\n"; else echo "<td>" . $a / $b . "</td>\n";
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.6
<td>6</td> b is zero Fatal error: Uncaught TypeError: Unsupported operand types: int / string in /in/prPfN:16 Stack trace: #0 {main} thrown in /in/prPfN on line 16
Process exited with code 255.
Output for 7.1.0 - 7.1.25, 7.2.0 - 7.2.33, 7.3.0 - 7.3.31, 7.4.0 - 7.4.33
<td>6</td> b is zero b is zero Notice: A non well formed numeric value encountered in /in/prPfN on line 21 <td>1</td> b is zero b is zero b is zero Fatal error: Uncaught Error: Unsupported operand types in /in/prPfN:41 Stack trace: #0 {main} thrown in /in/prPfN on line 41
Process exited with code 255.
Output for 7.0.0 - 7.0.20, 7.3.32 - 7.3.33
<td>6</td> b is zero b is zero <td>1</td> b is zero b is zero b is zero Fatal error: Uncaught Error: Unsupported operand types in /in/prPfN:41 Stack trace: #0 {main} thrown in /in/prPfN on line 41
Process exited with code 255.
Output for 4.3.2 - 4.3.11, 4.4.0 - 4.4.9, 5.0.0 - 5.0.5, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17, 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.24 - 5.5.35, 5.6.7 - 5.6.28
<td>6</td> b is zero b is zero <td>1</td> b is zero b is zero b is zero Fatal error: Unsupported operand types in /in/prPfN on line 41
Process exited with code 255.
Output for 4.3.0 - 4.3.1
<td>6</td> b is zero b is zero <td>1</td> b is zero b is zero b is zero Fatal error: Unsupported operand types in /in/prPfN on line 41

preferences:
251.43 ms | 402 KiB | 331 Q