Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Quoting the manual:</p> <blockquote> <p>The following error types cannot be handled with a user defined function: <code>E_ERROR</code>, <code>E_PARSE</code>, <code>E_CORE_ERROR</code>, <code>E_CORE_WARNING</code>, <code>E_COMPILE_ERROR</code>, <code>E_COMPILE_WARNING</code>, and most of <code>E_STRICT</code> raised in the file where <code>set_error_handler()</code> is called. </p> </blockquote> <p>This means Fatals cannot be caught and handled. What you <em>can</em> do is setup an additional handler to be run when the script exits, e.g. <a href="http://de.php.net/manual/en/function.register-shutdown-function.php" rel="nofollow"><code>register_shutdown_function</code></a>.</p> <p>In that handler, use <a href="http://de.php.net/manual/en/function.error-get-last.php" rel="nofollow"><code>error_get_last</code></a> and check if it was a Fatal Error. This will not allow you to continue script execution though. The script will end, but you can do any cleanup or logging (usually fatals will be logged anyway to the error.log) or whatever.</p> <p>There is a <a href="http://de.php.net/manual/en/function.set-error-handler.php#99193" rel="nofollow">user-supplied example in the comments below <code>set_error_handler</code></a></p> <pre><code>register_shutdown_function('shutdownFunction'); function shutDownFunction() { $error = error_get_last(); if ($error['type'] == 1) { //do your stuff } } </code></pre> <p>But note that this still will only catch certain additional runtime errors.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload