diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2020-02-28 15:53:04 +0100 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2020-02-28 15:54:42 +0100 |
commit | 87bc99439d5cdd3465ae37f1207067fc40ab7b19 (patch) | |
tree | 40c08142ae63fb72e5bd122b5b74c583517be09b /ext/reflection/php_reflection.c | |
parent | b314603f7fd0125b275efe7c3c1a3718bdf8f709 (diff) | |
download | php-git-87bc99439d5cdd3465ae37f1207067fc40ab7b19.tar.gz |
Fixed bug #64592
Make ReflectionClass::getMethods() behave the same ways as
ReflectionClass::getProperties() by not including private methods
from parent classes.
Diffstat (limited to 'ext/reflection/php_reflection.c')
-rw-r--r-- | ext/reflection/php_reflection.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index 101913c494..628d4f30ac 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -4056,6 +4056,10 @@ ZEND_METHOD(reflection_class, getMethod) /* {{{ _addmethod */ static void _addmethod(zend_function *mptr, zend_class_entry *ce, zval *retval, zend_long filter) { + if ((mptr->common.fn_flags & ZEND_ACC_PRIVATE) && mptr->common.scope != ce) { + return; + } + if (mptr->common.fn_flags & filter) { zval method; reflection_method_factory(ce, mptr, NULL, &method); |