|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2018-10-27 19:16 UTC] david at grudl dot com
Description:
------------
When an undefined exception with a callstack is printed in browser, it would be handy to use nl2br() for output to make the callstack more readable.
Expected result:
----------------
Fatal error: Uncaught Exception: The my exception in test.php:36
Stack trace:
#0 test.php(30): DemoClass::third(Array)
#1 test.php(24): DemoClass->second(true, false)
#2 test.php(44): DemoClass->first(10, 'any string')
#3 test.php(52): demo(10, 'any string')
#4 {main} thrown in test.php on line 36
Actual result:
--------------
Current output in HTML:
Fatal error: Uncaught Exception: The my exception in test.php:36 Stack trace: #0 test.php(30): DemoClass::third(Array) #1 test.php(24): DemoClass->second(true, false) #2 test.php(44): DemoClass->first(10, 'any string') #3 test.php(52): demo(10, 'any string') #4 {main} thrown in test.php on line 36
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 13:00:01 2025 UTC |
It is not related to var_dump() etc. Point is that error in PHP is printed this way: ------ <br /> <b>Fatal error</b>: Uncaught Error: Call to undefined function x() in file.php:5 Stack trace: #0 {main} thrown in <b>file.php</b> on line <b>5</b><br /> ---- I just suggest that it would be print like this: ------ <br /> <b>Fatal error</b>: Uncaught Error: Call to undefined function x() in file.php:5<br> Stack trace:<br> #0 {main}<br> thrown in <b>file.php</b> on line <b>5</b><br /> ---- Please, reopen it.