php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #48580 ArrayObject swallows properties (dump and reflection access) (PHP_5_2 only!)
Submitted: 2009-06-17 10:06 UTC Modified: 2009-09-27 01:00 UTC
From: toby@php.net Assigned:
Status: No Feedback Package: SPL related
PHP Version: 5.2.9 OS: Gentoo
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: toby@php.net
New email:
PHP Version: OS:

 

 [2009-06-17 10:06 UTC] toby@php.net
Description:
------------
Attributes defined in classes deriving from ArrayObject do not show up in var_dump() and cannot be accessed via Reflection.

Note that this is fixed in 5.3 already.

Reproduce code:
---------------
class Bar extends ArrayObject
{
    protected $foo = 23;
    private $bar = 42;
}

var_dump( new Bar() );

Expected result:
----------------
object(Bar)#1 (0) {
  ["foo:protected"]=>
  int(23)
  ["bar:private"]=>
  int(42)
}

Actual result:
--------------
object(Bar)#1 (0) {
}

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-09-19 14:52 UTC] jani@php.net
Still not fixed in 5.2.11..? Can you check and update the version if 
not..
 [2009-09-27 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Jan 15 11:01:31 2025 UTC