Bug #64592 [Com]: ReflectionClass::getMethods() returns methods out of scope
| From: | benjamin dot morel at gmail dot com | Date: | Wed, 29 Jun 2016 15:17:48 +0000 |
| Subject: | Bug #64592 [Com]: ReflectionClass::getMethods() returns methods out of scope | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-201911@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=64592&edit=1
ID: 64592
Comment by: benjamin dot morel at gmail dot com
Reported by: benjamin dot morel at gmail dot com
Summary: ReflectionClass::getMethods() returns methods out of
scope
Status: Open
Type: Bug
Package: Reflection related
Operating System: Linux
PHP Version: 5.4.13
Block user comment: N
Private report: N
New Comment:
7.0 would have been a perfect time for this. Too bad nobody took this bug seriously at the time.
Previous Comments:
------------------------------------------------------------------------
[2016-06-29 15:13:05] cmb@php.net
I think that suppressing inherited private properties, but showing
inherited private methods is very inconsistent behavior. However,
changing one or the other would likely require the RFC process,
see <https://wiki.php.net/rfc/howto>.
------------------------------------------------------------------------
[2013-04-08 08:54:01] benjamin dot morel at gmail dot com
@johannes too bad this comes up just a few days after the feature freeze for 5.5 :(
No chance this could be considered a bug, not a feature, and make it into 5.5?
I personally don't think it would be a huge problem, as most existing libraries
probably haven't started to modify their code for 5.5 compatibility, so it could
still be time to fix it?
------------------------------------------------------------------------
[2013-04-08 08:04:23] johannes@php.net
In general reflection in PHP leaks the "truth" by not hiding implementation details. This
falls into this category. Telling the truth is nice for maintainers but not really for users.
We can't change it in released (or feature frozen) versions so 5.6 might be an option. For that
we might collect more such cases and think about ringing Reflection on some higher level of
abstraction.
------------------------------------------------------------------------
[2013-04-07 12:53:40] felipe@php.net
Hey Johannes, what do you think about this behavior? Since reflection has worked in this way for a
long time...
------------------------------------------------------------------------
[2013-04-06 16:25:28] benjamin dot morel at gmail dot com
@felipe, did you read the bug before closing it? We're not talking about "not
accessible", but "not in scope".
This is totally different.
The fact is, if you run my example, getMethods() and getProperties() do not behave
in the same way, thus either this is a bug in getMethods(), and if not, this is a
bug in getProperties().
But I'm pretty sure it's getProperties() that behaves correctly here.
Could you please comment on this?
------------------------------------------------------------------------
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
https://bugs.php.net/bug.php?id=64592
--
Edit this bug report at https://bugs.php.net/bug.php?id=64592&edit=1