3v4l.org

run code in 300+ PHP versions simultaneously
<?php <?php function inverse($x) { if (!$x) { 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.3.0 - 5.3.27, 5.4.0 - 5.4.20
Parse error: syntax error, unexpected '<' in /in/gCmb5 on line 1
Process exited with code 255.

preferences:
179.54 ms | 1395 KiB | 56 Q