Suppose you have a class A with a private property $a, and a class B which inherits from that. If I use ReflectionClass::getProperty on an instance of B, I get a fatal error, that the property doesn't exists. This makes sense, as it is it a private method. However, ReflectionClass::hasProperty returns true, nonetheless. Is this a bug?
A:
Hi,
This bug seems to be about this problem : Bug #47808 : hasProperty inconsistent with getProperty and new ReflectionProperty
It's been marked as "fixed in SVN" on August the 4th, which is quite recent ; maybe it's solved in a version of PHP more recent than the one you are using ?
Well, doesn't seem to appear in the PHP 5 ChangeLog -- so I'm guessing that fix has not been released yet... Or not documented or anything...
Pascal MARTIN
2009-09-30 04:27:39