From 87bc99439d5cdd3465ae37f1207067fc40ab7b19 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Fri, 28 Feb 2020 15:53:04 +0100 Subject: Fixed bug #64592 Make ReflectionClass::getMethods() behave the same ways as ReflectionClass::getProperties() by not including private methods from parent classes. --- ext/reflection/php_reflection.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'ext/reflection/php_reflection.c') 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); -- cgit v1.2.1