Stop PHP’s dangerous name handling
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Stop PHP’s dangerous name handling | |
function undefined_name_error($errno, $errstr, $errfile='', $errline=0, $errcontext=NULL) { | |
if (stripos($errstr, 'Undefined') !== false) { | |
error_log("PHP Fatal error: $errstr in $errfile on line $errline"); | |
exit(255); | |
} | |
else { | |
return false; | |
} | |
} | |
set_error_handler('undefined_name_error', E_NOTICE); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment