Edit report at https://bugs.php.net/bug.php?id=63256&edit=1
ID: 63256 Updated by: larue...@php.net Reported by: asynchronio at gmail dot com Summary: ReflectionProperty::getName() returns false Status: Open Type: Bug Package: Reflection related Operating System: Windows 7 (x64) PHP Version: 5.4.7 Block user comment: N Private report: N New Comment: I am not sure what's the problem is? did you mean getValue? Previous Comments: ------------------------------------------------------------------------ [2012-10-10 21:48:33] asynchronio at gmail dot com Description: ------------ ReflectionProperty name getter returns false, but getting name directly works fine. Test script: --------------- <?php class Test { public $foo = 1; public $bar = 2; public function test() { $class = new ReflectionClass(get_class($this)); $names = array(); foreach($class->getProperties() as $property) { $names[] = $property->getName(); // This code works: // $names[] = $property->name; } return $names; } } $test = new Test(); var_dump($test->test()); Expected result: ---------------- array(2) { [0]=> 1 [1]=> 2 } Actual result: -------------- array(2) { [0]=> string(3) "foo" [1]=> string(3) "bar" } ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=63256&edit=1