From: anthon dot pang at gmail dot com
Operating system: Ubuntu 12.04
PHP version: 5.5.0alpha1
Package: Reflection related
Bug Type: Bug
Bug description:ReflectionClass->getProperties() omits private members of
parent classes
Description:
------------
getProperties() doesn't include "private" scoped properties from parent
classes
Test script:
---------------
<?php
abstract class Foo {
public $a;
protected $b;
private $c;
}
class Bar extends Foo {
public $d;
protected $e;
private $f;
}
$obj = new Bar;
$reflection = new ReflectionClass($obj);
$propertyList = $reflection->getProperties();
foreach ($propertyList as $property) {
var_dump($property->getName());
}
Expected result:
----------------
string(1) "d"
string(1) "e"
string(1) "f"
string(1) "a"
string(1) "b"
string(1) "c"
Actual result:
--------------
string(1) "d"
string(1) "e"
string(1) "f"
string(1) "a"
string(1) "b"
--
Edit bug report at https://bugs.php.net/bug.php?id=63582&edit=1
--
Try a snapshot (PHP 5.4):
https://bugs.php.net/fix.php?id=63582&r=trysnapshot54
Try a snapshot (PHP 5.3):
https://bugs.php.net/fix.php?id=63582&r=trysnapshot53
Try a snapshot (trunk):
https://bugs.php.net/fix.php?id=63582&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=63582&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=63582&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=63582&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=63582&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=63582&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=63582&r=support
Expected behavior: https://bugs.php.net/fix.php?id=63582&r=notwrong
Not enough info:
https://bugs.php.net/fix.php?id=63582&r=notenoughinfo
Submitted twice:
https://bugs.php.net/fix.php?id=63582&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=63582&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=63582&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=63582&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=63582&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=63582&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=63582&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=63582&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=63582&r=mysqlcfg