3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php if (!interface_exists('Throwable')) { interface Throwable{} } if (true) { class FooException extends Exception implements Throwable {} class BarException implements Throwable {} }
based on hb5a9
Output for 7.0.0 - 7.3.0
Fatal error: Class BarException cannot implement interface Throwable, extend Exception or Error instead in /in/o2t00 on line 9
Process exited with code 255.
Output for hhvm-3.22.0
Fatal error: Uncaught Error: Class BarException contains abstract method (getMessage) and must therefore be declared abstract or implement the remaining methods in /in/o2t00:-1 Stack trace: #0 {main}
Process exited with code 255.
Output for hhvm-3.18.5 - 3.21.3
Fatal error: Uncaught Error: Class BarException contains abstract method (getMessage) and must therefore be declared abstract or implement the remaining methods in /in/o2t00:9 Stack trace: #0 {main}
Process exited with code 255.
Output for 5.6.0 - 5.6.38