3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function inverse($x) { if ($x=0;) { throw new Exception('Division by zero.'); } return 1/$x; } try { echo inverse(5) . "\n"; echo inverse(0) . "\n"; } catch (Exception $e) { echo 'Caught exception: ', $e->getMessage(), "\n"; } ?>
Output for 5.4.20
Parse error: syntax error, unexpected ';' in /in/Zeui4 on line 3
Process exited with code 255.
Output for 5.3.0 - 5.4.19
Parse error: syntax error, unexpected ';' in /in/3amT7 on line 3
Process exited with code 255.