- var_dump: documentation ( source)
- strpos: documentation ( source)
- error_get_last: documentation ( source)
- register_shutdown_function: documentation ( source)
- set_error_handler: documentation ( source)
<?php
set_error_handler(function(){
if (strpos($errstr, 'Class')) {
var_dump('foo');
return true;
}
return false;
});
register_shutdown_function('fatalErrorShutdownHandler');
function fatalErrorShutdownHandler()
{
$last_error = error_get_last();
if ($last_error['type'] === E_ERROR) {
// fatal error
myErrorHandler(E_ERROR, $last_error['message'], $last_error['file'], $last_error['line']);
}
}
Everything::is('awesome');
echo Everything;