php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #43713 each() - Wrong properties name in return value
Submitted: 2007-12-30 20:44 UTC Modified: 2007-12-30 20:56 UTC
From: felipe@php.net Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 5.3CVS-2007-12-30 (CVS) OS:
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: felipe@php.net
New email:
PHP Version: OS:

 

 [2007-12-30 20:44 UTC] 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


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-12-30 20:56 UTC] derick@php.net
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

.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Tue May 13 07:01:26 2025 UTC