<?php
class A extends Exception {}
class B extends Exception {}
try {
throw new A('a');
} catch (A $e) {
var_dump($e->getMessage());
throw new B('b');
} catch (Exception $e) {
var_dump($e->getMessage());
}
string(1) "a"
Fatal error: Uncaught exception 'B' with message 'b' in /in/6F1Am:10
Stack trace:
#0 {main}
thrown in /in/6F1Am on line 10
Process exited with code 255.
Output for 5.0.3 - 5.0.4
string(1) "a"
Fatal error: Uncaught exception 'B' with message 'b' in /in/6F1Am:10
Stack trace:
#0 /in/6F1Am(10): unknown()
#1 {main}
thrown in /in/6F1Am on line 10
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected '{' in /in/6F1Am on line 6
Process exited with code 255.