- time: documentation ( source)
- register_shutdown_function: documentation ( source)
- set_error_handler: documentation ( source)
<?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';
}