3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?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 7.1.0
<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.14
<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 hhvm-3.10.0 - 3.12.0
<td>6</td> b is zero b is zero <td>1</td> b is zero b is zero b is zero Fatal error: Invalid operand type was used: cannot perform this operation with arrays in /in/prPfN on line 41
Process exited with code 255.
Output for 4.3.2 - 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