note 125237 added to function.debug-print-backtrace
| From: | DavidSpector@php.net | Date: | Sun, 02 Aug 2020 14:58:21 +0000 |
| Subject: | note 125237 added to function.debug-print-backtrace | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-214920@lists.php.net to get a copy of this message | ||
If your show your error messages in HTML (with suitable safety using entities), this function
won't work nicely because it uses newlines for formatting.
Here is a function that works similarly, but using <BR> tags. Insert it near the beginning of
your program to add a stack to Warning output only, or modify it as you like:
// Here is code for error stack output in HTML:
function error_handler_callback($errno,$message,$file,$line,$context)
{
if ($errno === E_WARNING)
echo "Stack, innermost first:<br>".nl2br((new
Exception())->getTraceAsString());
return false; // to execute the regular error handler
}
set_error_handler("error_handler_callback");
----
Server IP: 45.112.84.4
Probable Submitter: 103.51.166.36 (proxied: 98.2.238.89)
----
Manual Page -- http://php.net/manual/en/function.debug-print-backtrace.php
Edit -- https://master.php.net/note/edit/125237
Del: integrated -- https://master.php.net/note/delete/125237/integrated
Del: useless -- https://master.php.net/note/delete/125237/useless
Del: bad code -- https://master.php.net/note/delete/125237/bad+code
Del: spam -- https://master.php.net/note/delete/125237/spam
Del: non-english -- https://master.php.net/note/delete/125237/non-english
Del: in docs -- https://master.php.net/note/delete/125237/in+docs
Del: other reasons-- https://master.php.net/note/delete/125237
Reject -- https://master.php.net/note/reject/125237
Search -- https://master.php.net/manage/user-notes.php