3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public function x(): void {} } set_error_handler(function() { echo 'handled'; }); register_shutdown_function(function() { echo 'shutdown...'; }); echo 'before test...'; try { if (time() > 0) { // wrap in if to make sure an error is not throw at compile time class B extends A { public function x() {} } } } catch (\Throwable $e) { echo 'catched'; }

preferences:
37.01 ms | 402 KiB | 5 Q