3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class MyFancyMessage {} function testThis() { throw new MyFancyMessage; } try { testThis(); } catch (MyFancyMessage $m) { echo 'got a fancy message'; }
Output for 7.0.0 - 7.3.0beta2
Fatal error: Uncaught Error: Cannot throw objects that do not implement Throwable in /in/auh3Q:6 Stack trace: #0 /in/auh3Q(10): testThis() #1 {main} thrown in /in/auh3Q on line 6
Process exited with code 255.
Output for hhvm-3.22.0
Fatal error: Uncaught Error: Exceptions must implement the Throwable interface. in /in/auh3Q:-1 Stack trace: #0 /in/auh3Q(-1): testThis() #1 {main}
Process exited with code 255.
Output for hhvm-3.15.4 - 3.21.3
Fatal error: Uncaught Error: Exceptions must implement the Throwable interface. in /in/auh3Q:6 Stack trace: #0 /in/auh3Q(10): testThis() #1 {main}
Process exited with code 255.
Output for 5.6.30
Fatal error: Exceptions must be valid objects derived from the Exception base class in /in/auh3Q on line 6
Process exited with code 255.