#43713 [Opn->Bgs]: each() - Wrong properties name in return value

From: Date: Sun, 30 Dec 2007 20:56:48 +0000
Subject: #43713 [Opn->Bgs]: each() - Wrong properties name in return value
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-120951@lists.php.net to get a copy of this message
ID: 43713 Updated by: derick@php.net Reported By: felipe@php.net -Status: Open +Status: Bogus Bug Type: Scripting Engine problem PHP Version: 5.3CVS-2007-12-30 (CVS) New Comment: Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php . Previous Comments: ------------------------------------------------------------------------ [2007-12-30 20:44:28] felipe@php.net Description: ------------ I suppose that the result is unexpected. Reproduce code: --------------- <?php class foo { public $test1 = 1; private $test2 = 2; protected $test3 = 3; public function __construct() { while (list($key, $value) = each($this)) { print $key . ' => '. $value ."\n"; } } } new foo; Expected result: ---------------- test1 => 1 test2 => 2 test3 => 3 Actual result: -------------- test1 => 1 footest2 => 2 *test3 => 3 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=43713&edit=1

« previous php.bugs (#120951) next »