|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #61804 trigger_error() truncates at \0
Submitted: 2012-04-21 23:31 UTC Modified: 2012-04-22 04:29 UTC
From: binarte at gmail dot com Assigned:
Status: Wont fix Package: Output Control
PHP Version: 5.4.0 OS: Linux Mint
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
Solve the problem:
6 + 23 = ?
Subscribe to this entry?

 [2012-04-21 23:31 UTC] binarte at gmail dot com
Calls to trigger_error() gets the message truncated whenever 

Test script:

$str = 'a';
for ($x = 0; $x < 0x20; $x++){
	$str .= chr($x);	
$str .= 'b';


Expected result:
Notice: a  b in /home/.../bug.php on line 9

Actual result:
Notice: a in /home/.../bug.php on line 9


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2012-04-21 23:33 UTC] binarte at gmail dot com
Calls to trigger_error() gets the message truncated whenever the message contains \0. Haven't tested with other characters, but I believe the bug shouldn't be much diffirint if other characters truncate the message anyway.
 [2012-04-22 04:29 UTC]
-Status: Open +Status: Wont fix
 [2012-04-22 04:29 UTC]
error message is null-terminated string
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Fri Dec 08 09:01:27 2023 UTC