From:             exaton at free dot fr
Operating system: WinXP Pro SP2
PHP version:      5CVS-2005-02-13 (dev)
PHP Bug Type:     Class/Object related
Bug description:  Exception message length is limited

Description:
------------
[With PHP 5.0.4-dev Feb 13 2005 10:15:43 running on Apache 2.0.52 in
Windows XP SP2]

It appears that Exceptions have some sort of limit on the length of their
messages. When the message is too long, the throwing info is simply
truncated, leaving only the "in <file> on line <line>" intact at the end.

Upon causing an Exception thus (sorry for the length, but it's the whole
point) :

throw new
Exception('012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567!
8');

one will notice the truncature described. Adding more figures to the
message will not change the incorrect output (truncature occurs at the
same length). Shortening that message, on the other hand, will
progressively "reveal" the rest of the throwing info.
(N.B. : because of HTML whitespace this is not evident until the message
is shortened by at least 4 or 5 bytes).

In this instance, the limit is of 979 bytes in the message, for a total of
1127 bytes of HTML-decorated throwing info. These figures vary however,
total throwing info 1161 bytes long, eg., having also been encountered, in
another situation.

Said situation is a complex cause-exceptions handling part of my company's
web development kit (much to long and involuted to present as reproduce
code). Just saying that to explain how I came across such an error : the
throwing info of cause exceptions, nested to arbitrary depth, can produce
a very long message for the top Exception thrown.

Thank you for your time in solving this.


-- 
Edit bug report at http://bugs.php.net/?id=31955&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=31955&r=trysnapshot4
Try a CVS snapshot (php5.0): 
http://bugs.php.net/fix.php?id=31955&r=trysnapshot50
Try a CVS snapshot (php5.1): 
http://bugs.php.net/fix.php?id=31955&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=31955&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=31955&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=31955&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=31955&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=31955&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=31955&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=31955&r=notwrong
Not enough info:             
http://bugs.php.net/fix.php?id=31955&r=notenoughinfo
Submitted twice:             
http://bugs.php.net/fix.php?id=31955&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=31955&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=31955&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=31955&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=31955&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=31955&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=31955&r=float
No Zend Extensions:          http://bugs.php.net/fix.php?id=31955&r=nozend
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=31955&r=mysqlcfg

Reply via email to