Bug #63980 [Csd]: object members get trimmed by zero bytes
Edit report at https://bugs.php.net/bug.php?id=63980&edit=1
ID: 63980
User updated by: thbley at gmail dot com
Reported by: thbley at gmail dot com
Summary: object members get trimmed by zero bytes
Status: Closed
Type: Bug
Package: *General Issues
Operating System: Win64
PHP Version: 5.5.0alpha3-nts
Assigned To: laruence
Block user comment: N
Private report: N
New Comment:
Windows snapshots are currently not available, so I tried php5.5-201301151230 on Ubuntu and it
works, thanks a lot!
Previous Comments:
------------------------------------------------------------------------
[2013-01-14 08:32:55] laruence@php.net
The fix for this bug has been committed.
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/.
For Windows:
http://windows.php.net/snapshots/
Thank you for the report, and for helping us make PHP better.
------------------------------------------------------------------------
[2013-01-14 08:24:36] laruence@php.net
Automatic comment on behalf of laruence
Revision: http://git.php.net/?p=php-src.git;a=commit;h=62059c16ee2f2802caa00f2aad2fa44c867dd1f1
Log: Fixed bug #63980 (object members get trimmed by zero bytes)
------------------------------------------------------------------------
[2013-01-14 08:23:58] laruence@php.net
Automatic comment on behalf of laruence
Revision: http://git.php.net/?p=php-src.git;a=commit;h=62059c16ee2f2802caa00f2aad2fa44c867dd1f1
Log: Fixed bug #63980 (object members get trimmed by zero bytes)
------------------------------------------------------------------------
[2013-01-14 03:44:57] laruence@php.net
The following patch has been added/updated:
Patch Name: bug63980.patch
Revision: 1358135097
URL: https://bugs.php.net/patch-display.php?bug=63980&patch=bug63980.patch&revision=1358135097
------------------------------------------------------------------------
[2013-01-13 16:07:18] thbley at gmail dot com
Thanks, var_dump() works. But it would be great if get_object_vars() and foreach() could be fixed.
Here is a more detailed test:
$arr = ["abc\0def" => "abc\0def"];
$obj = (object)$arr;
print_r($arr); // ok
echo "\n";
var_dump($obj); // ok
echo "\n";
echo serialize($obj); // ok
echo "\n";
echo (int)property_exists($obj, "abc"); // ok
echo "\n";
echo (int)isset($obj->{"abc"}); // ok
echo "\n";
echo json_encode($obj); // ok
echo "\n";
var_dump((array)$obj); // ok
echo "\n";
var_export($obj); // bug
echo "\n";
print_r($obj); // bug
echo "\n";
debug_zval_dump($obj); // bug
echo "\n";
var_dump(get_object_vars($obj)); // bug
echo "\n";
echo get_object_vars($obj)["abc"]; // bug
echo "\n";
foreach ($obj as $key=>$val) {
echo $key." : ".$val."\n"; // bug
}
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=63980
--
Edit this bug report at https://bugs.php.net/bug.php?id=63980&edit=1
Thread (7 messages)