Req #77075 [Wfx]: Add <br> to the exception reporting in HTML

From: Date: Wed, 07 Apr 2021 17:37:37 +0000
Subject: Req #77075 [Wfx]: Add <br> to the exception reporting in HTML
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-233303@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=77075&edit=1

 ID:                 77075
 User updated by:    david at grudl dot com
 Reported by:        david at grudl dot com
 Summary:            Add <br> to the exception reporting in HTML
 Status:             Wont fix
 Type:               Feature/Change Request
 Package:            Output Control
 PHP Version:        7.3.0RC4
 Assigned To:        cmb
 Block user comment: N
 Private report:     N

 New Comment:

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.


Previous Comments:
------------------------------------------------------------------------
[2021-04-06 15:12:39] cmb@php.net

I don't think addressing this particular case makes sense; other
debug output (var_dump() etc.) has the same issue.  You can use
Xdebug to "fix" that.

If you feel strongly that this should be implemented, please
pursue the RFC process[1].

[1] <https://wiki.php.net/rfc/howto>

------------------------------------------------------------------------
[2018-10-27 19:16:27] 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


------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=77075&edit=1


Thread (5 messages)

« previous php.bugs (#233303) next »