Bug #63980 [Opn->Fbk]: object members get trimmed by zero bytes
Edit report at https://bugs.php.net/bug.php?id=63980&edit=1
ID: 63980
Updated by: laruence@php.net
Reported by: thbley at gmail dot com
Summary: object members get trimmed by zero bytes
-Status: Open
+Status: Feedback
Type: Bug
Package: *General Issues
Operating System: Win64
PHP Version: 5.5.0alpha2
Block user comment: N
Private report: N
New Comment:
it's due to print_r specific behavior for object's properties...
if you use var_dump instead, you will see it's not trimmed.
Previous Comments:
------------------------------------------------------------------------
[2013-01-13 02:33:33] thbley at gmail dot com
Description:
------------
Array keys are not trimmed by zero bytes. (ok)
Object member names are trimmed by zero bytes. (bug)
Test script:
---------------
$arr = ["abc\0def" => "abc\0def"];
print_r($arr);
print_r((object)$arr);
Expected result:
----------------
Array
(
[abc def] => abc def
)
stdClass Object
(
[abc def] => abc def
)
Actual result:
--------------
Array
(
[abc def] => abc def
)
stdClass Object
(
[abc] => abc def
)
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=63980&edit=1
Thread (7 messages)