I am running a script that requires a file which is not properly included in my script.
PHP Fatal error: require_once(): Failed opening required 'Math/BigInteger.php' (include_path='.:/usr/share/php:/usr/share/pear') in /myDir/Net/SSH2.php on line 746
I have an error_handler
set up, which records every error I get:
function script_error_handler($errno, $errstr, $errfile, $errline){
echo "IN ERROR HANDLER
";
$GLOBALS['errors'][] = array(
'errno' => $errno,
'errstr' => $errstr,
'errfile' => $errfile,
'errline' => $errline
);
return true;
}
I also have a shutdown_function
which later goes through the errors to determine success or failure (among other things). Part of that function prints the errors I have recorded.
function shutdown_handler($io) {
print_r($GLOBALS['errors']);
echo "
";
//irrelevant stuff ommitted
}
Oddly, the output of this is as follows:
Array
(
[0] => Array
(
[errno] => 2
[errstr] => require_once(Math/BigInteger.php): failed to open stream: No such file or directory
[errfile] => /myDir/Net/SSH2.php
[errline] => 746
)
)
According to PHP's Predefined Constants, 2
is the value of an E_WARNING
.
2 | E_WARNING (integer) | Run-time warnings (non-fatal errors). Execution of the script is not halted.
This seems to be in clear conflict with the Fatal Error
output I get earlier. Why don't I get an E_ERROR
in this situation? What is going on here?