- error_get_last: documentation ( source)
- print_r: documentation ( source)
- register_shutdown_function: documentation ( source)
<?php
function shutdown() {
echo "triggered\n";
if (@is_array($e = @error_get_last())) {
$code = isset($e['type']) ? $e['type'] : 0;
$msg = isset($e['message']) ? $e['message'] : '';
$file = isset($e['file']) ? $e['file'] : '';
$line = isset($e['line']) ? $e['line'] : '';
print_r( array( $code, $msg, $file, $line ) );
}
}
register_shutdown_function( 'shutdown' );
echo "start\n";
bla();
echo "end\n";