#39104 [Opn->Bgs]: ReflectionClass::getMethod and private method
ID: 39104
Updated by: tony2001@php.net
Reported By: dave at dgx dot cz
-Status: Open
+Status: Bogus
Bug Type: SPL related
PHP Version: 5.2.0RC5
New Comment:
>ReflectionProperty::getDeclaringClass()->getName() -> Foo
>ReflectionMethod::getDeclaringClass()->getName() -> Extended
>Both property and method are declared in Foo and
>redeclared in Extended.
There is no difference whether a public property was declared in the
parent or in the child - in both cases it exists in the lists of
properties of both classes.
And there is a big difference if a public method gets redeclared,
because it would be executed in the scope of the class where it was
executed.
This scope is used as the "declaring class".
So it is expected, yes.
The second problem is assigned to me, no need to create another report
about it.
Previous Comments:
------------------------------------------------------------------------
[2006-10-13 06:59:01] dave at dgx dot cz
.
------------------------------------------------------------------------
[2006-10-10 10:51:14] dave at dgx dot cz
Expected??
1)
ReflectionProperty::getDeclaringClass()->getName() -> Foo
ReflectionMethod::getDeclaringClass()->getName() -> Extended
Both property and method are declared in Foo and redeclared in
Extended.
2) How can I detect that private method is declared in reflected class,
and not in any parent class?
------------------------------------------------------------------------
[2006-10-10 10:44:47] tony2001@php.net
Expected behaviour.
------------------------------------------------------------------------
[2006-10-10 09:52:22] dave at dgx dot cz
The behaviour is still the same.
------------------------------------------------------------------------
[2006-10-10 08:53:46] tony2001@php.net
Please try using this CVS snapshot:
http://snaps.php.net/php5.2-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php5.2-win32-latest.zip
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/39104
--
Edit this bug report at http://bugs.php.net/?id=39104&edit=1
Thread (8 messages)