3v4l.org

run code in 300+ PHP versions simultaneously
<?php class NonFatalException extends Exception { } try { throw new NonFatalException("hello"); } catch(SomeException $e) { // some error handling } catch(NonFatalException $e) { echo "caught nonfatal"; rethrow $e; } catch (Exception $e) { echo "caught general"; }
Output for 5.4.0 - 5.4.23
Parse error: syntax error, unexpected '$e' (T_VARIABLE) in /in/YSPqF on line 12
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected T_VARIABLE in /in/YSPqF on line 12
Process exited with code 255.

preferences:
191.36 ms | 1395 KiB | 60 Q