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
Have you experienced this issue?
Rate the importance of this bug to you:

 [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

Add a Patch

Pull Requests

Add a Pull Request

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-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 20 02:01:29 2024 UTC