php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #42272 var_export() incorrectly escapes char(0)
Submitted: 2007-08-11 15:50 UTC Modified: 2007-12-18 10:55 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: pilots at rambler dot ru Assigned:
Status: Closed Package: Variables related
PHP Version: 5.2.4RC1 OS: WindowsXP
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: pilots at rambler dot ru
New email:
PHP Version: OS:

 

 [2007-08-11 15:50 UTC] pilots at rambler dot ru
Description:
------------
var_export() incorrectly escapes char(0) in strings. It returns '\000' in single quotes, therefore then this string can not be imported correctly.


Reproduce code:
---------------
eval('echo '.var_export("\0",true).';');

Expected result:
----------------
// chr(0)

Actual result:
--------------
\000

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-12-09 16:55 UTC] derick@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 [2007-12-17 13:39 UTC] derick@php.net
There is still an issue, with array keys and \0
 [2007-12-18 10:55 UTC] derick@php.net
Fixed now.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 22 17:01:29 2024 UTC