Voting

: min(three, three)?
(Example: nine)

The Note You're Voting On

ohcc at 163 dot com
4 years ago
As of PHP 7.4, an exception thrown within the user-defined shutdown function can be caught by the user-defined exception handler.

<?php
set_error_handler
(
function(
$level, $error, $file, $line){
if(
0 === error_reporting()){
return
false;
}
throw new
ErrorException($error, -1, $level, $file, $line);
},
E_ALL
);

register_shutdown_function(function(){
$error = error_get_last();
if(
$error){
throw new
ErrorException($error['message'], -1, $error['type'], $error['file'], $error['line']);
}
});

set_exception_handler(function($exception){
// ... more code ...
});

require
'NotExists.php';

<< Back to user notes page

To Top