|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2012-04-19 20:22 UTC] johannes@php.net
[2012-04-19 20:22 UTC] johannes@php.net
-Status: Open
+Status: Not a bug
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 12:00:02 2025 UTC |
Description: ------------ When using the each() function on objects, private and protected variables gets a NUL character around them (see expected result). Create the test script and view it in a browser (I used Firefox 11.0). If you send an email with the output, the mail() function will just truncate the message after the NUL character Test script: --------------- class Foo { public $a; protected $b; private $c; function bar($value) { echo $value; } } $tmp = new Foo(); while(list($key, $value) = each($tmp)) { var_dump($key); } Expected result: ---------------- string(1) "a" string(4) "*b" string(6) "Fooc" Without the NUL character Actual result: -------------- string(1) "a" string(4) "�*�b" string(6) "�Foo�c" � = NUL character, ASCII code (dec): 0