- set_exception_handler: documentation ( source)
- set_error_handler: documentation ( source)
<?php
set_error_handler(function($no, $str, $file, $line) {
throw new ErrorException($str, 0, $no, $file, $line);
});
set_exception_handler(function(\Exception $e) {
echo "Halp! I cant rite teh codez: " . $e->getMessage() . "\n" . $e->getTraceAsString();
});
eval('class A { public function foo() {} } class B extends A { public function foo($bar) {} }');