- var_dump: documentation ( source)
- error_get_last: documentation ( source)
- register_shutdown_function: documentation ( source)
- error_reporting: documentation ( source)
- set_error_handler: documentation ( source)
<?php
/*E_ERROR
E_CORE_ERROR
E_CORE_WARNING
E_COMPILE_ERROR
*/
function exception_error_handler($errno, $errstr, $errfile, $errline) {
var_dump($errstr);
}
set_error_handler("exception_error_handler", error_reporting());
function shutDownFunction() {
echo 'as';
$error = error_get_last();
if ($error['type'] == 1) {
//do your stuff
}
}
register_shutdown_function('shutdownFunction');
function f() {
return 'Hello world';
}
if( empty( f() ) ) {
// do something
}