3v4l.org

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