3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class A extends Exception{} class B extends Exception{} try { throw new A('Message 1'); } catch(A $e) { throw new B('Message 2', 0, $e); }
based on qbeH5
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught A: Message 1 in /in/PLada:8 Stack trace: #0 {main} Next B: Message 2 in /in/PLada:12 Stack trace: #0 {main} thrown in /in/PLada on line 12
Process exited with code 255.
Output for 5.3.18 - 5.6.28
Fatal error: Uncaught exception 'A' with message 'Message 1' in /in/PLada:8 Stack trace: #0 {main} Next exception 'B' with message 'Message 2' in /in/PLada:12 Stack trace: #0 {main} thrown in /in/PLada on line 12
Process exited with code 255.