3v4l.org

run code in 300+ PHP versions simultaneously
<?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.3.0 - 5.3.27, 5.4.0 - 5.4.20
Parse error: syntax error, unexpected '=' in /in/PvRFT on line 10
Process exited with code 255.

preferences:
167.51 ms | 1399 KiB | 56 Q