Bug #77629 [Fbk->NoF]: Unexpected output of get_class_methods and ReflectionClass::getMethods
| From: | php-bugs at lists dot php dot net | Date: | Sun, 03 Mar 2019 04:22:05 +0000 |
| Subject: | Bug #77629 [Fbk->NoF]: Unexpected output of get_class_methods and ReflectionClass::getMethods | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-219821@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=77629&edit=1
ID: 77629
Updated by: php-bugs@lists.php.net
Reported by: php dot florianberberich at outlook dot com
Summary: Unexpected output of get_class_methods and
ReflectionClass::getMethods
-Status: Feedback
+Status: No Feedback
Type: Bug
Package: Reflection related
Operating System: irrelevant
PHP Version: 7.3.2
Private report: N
New Comment:
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
Previous Comments:
------------------------------------------------------------------------
[2019-02-17 13:20:34] requinix@php.net
I don't understand what bug you're reporting. Is the method list missing something? Or
including a method it shouldn't? Because I don't know of anything anywhere that promises
them in a particular order.
------------------------------------------------------------------------
[2019-02-17 13:12:21] php dot florianberberich at outlook dot com
Description:
------------
I played around with get_class_methods and Reflection::getMethods and found an imo strange
behaviour.
The sequence of the methods found is the following:
- methods implemented (or declared if still abstract) in the class
- methods implemented (...) in the parent class
- methods implemented (...) in the parent's parent class
- methods implemented (...) in the parent's parent class used traits
- methods implemented (...) in the parent class used traits
- methods implemented (...) in the class used traits
- methods declared (but not yet implemented) in the parent's parent class implemented
interfaces
- methods declared (but not yet implemented) in the parent class implemented interfaces
- methods declared (but not yet implemented) in the class implemented interfaces
What I expected was:
- methods implemented in the class
- methods implemented in the class used traits
- methods implemented in the parent class
- methods implemented in the parent class used traits
- methods implemented in the parent's parent class
- methods implemented in the parent's parent class used traits
- methods declared (but not yet implemented) in the class
- methods declared (...) in the class implemented interfaces
- methods declared (...) in the parent class
- methods declared (...) in the parent class implemented interfaces
- ...
Test script:
---------------
https://3v4l.org/OTqtL
Expected result:
----------------
initMethodInitTest
initMethodInit1
initMethodChangeBehaviourOfInitTest
initMethodInit2
initMethodInitTest
initMethodInit1
Actual result:
--------------
initMethodInitTest
initMethodInit1
initMethodChangeBehaviourOfInitTest
initMethodInitTest
initMethodInit1
initMethodInit2
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=77629&edit=1