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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
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

Add a Patch

Pull Requests

Add a Pull Request

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-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 01:01:28 2024 UTC