- var_dump: documentation ( source)
- register_shutdown_function: documentation ( source)
- set_error_handler: documentation ( source)
<?php
$success=false;
if (true){
set_error_handler(function($a, $b, $c, $d) {
var_dump('error_handler', $a, $b, $c, $d);
});
register_shutdown_function(function(){
if ($success){return;}
var_dump(get_last_error());
});
}
$var = 1;
try {
$var->method(); // Throws an Error object in PHP 7.
} catch (Error $e) {
// Handle error
var_dump('error', $e);
} catch (Exception $e) {
// Handle error
var_dump('exception', $e);
}
$success=true;
?>