Created
January 15, 2024 14:38
-
-
Save svandragt/b303ce2d8d40050c6b9b8a50cb68f756 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
register_shutdown_function('handleShutdown'); | |
function handleShutdown() { | |
$lastError = error_get_last(); | |
if (null !== $lastError) { | |
switch ($lastError['type']) { | |
case E_ERROR: | |
case E_PARSE: | |
case E_CORE_ERROR: | |
case E_CORE_WARNING: | |
case E_COMPILE_ERROR: | |
case E_COMPILE_WARNING: | |
echo 'A fatal error occurred, stopping script execution'; | |
xdebug_break(); // This will trigger the debugger | |
break; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment