3v4l.org

run code in 300+ PHP versions simultaneously
<?php class foo { function __construct() { echo "Inside constructor\n"; throw new Exception; } function __destruct() { echo "Inside destructor\n"; } } try { $bar = new foo; }
Output for 5.4.0 - 5.4.24
Parse error: syntax error, unexpected end of file, expecting catch (T_CATCH) in /in/iGc94 on line 15
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected $end, expecting T_CATCH in /in/iGc94 on line 15
Process exited with code 255.

preferences:
188.1 ms | 940 KiB | 62 Q