diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2018-07-02 21:33:09 +0200 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2018-07-02 21:33:09 +0200 |
commit | 23ae6ca405f7133d8882e9957df69980362906ad (patch) | |
tree | 8d3a62bf5bb021d29a9ca41aad92b59245c75ac3 /ext/reflection/php_reflection.c | |
parent | 826e403d2c3e284aff78a1ea982819e27be7d03e (diff) | |
download | php-git-23ae6ca405f7133d8882e9957df69980362906ad.tar.gz |
Fix check for invoking abstract method
Diffstat (limited to 'ext/reflection/php_reflection.c')
-rw-r--r-- | ext/reflection/php_reflection.c | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index 7a313813a9..03590d47e7 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -3089,21 +3089,19 @@ static void reflection_method_invoke(INTERNAL_FUNCTION_PARAMETERS, int variadic) GET_REFLECTION_OBJECT_PTR(mptr); - if ((!(mptr->common.fn_flags & ZEND_ACC_PUBLIC) - || (mptr->common.fn_flags & ZEND_ACC_ABSTRACT)) - && intern->ignore_visibility == 0) - { - if (mptr->common.fn_flags & ZEND_ACC_ABSTRACT) { - zend_throw_exception_ex(reflection_exception_ptr, 0, - "Trying to invoke abstract method %s::%s()", - ZSTR_VAL(mptr->common.scope->name), ZSTR_VAL(mptr->common.function_name)); - } else { - zend_throw_exception_ex(reflection_exception_ptr, 0, - "Trying to invoke %s method %s::%s() from scope %s", - mptr->common.fn_flags & ZEND_ACC_PROTECTED ? "protected" : "private", - ZSTR_VAL(mptr->common.scope->name), ZSTR_VAL(mptr->common.function_name), - ZSTR_VAL(Z_OBJCE_P(getThis())->name)); - } + if (mptr->common.fn_flags & ZEND_ACC_ABSTRACT) { + zend_throw_exception_ex(reflection_exception_ptr, 0, + "Trying to invoke abstract method %s::%s()", + ZSTR_VAL(mptr->common.scope->name), ZSTR_VAL(mptr->common.function_name)); + return; + } + + if (!(mptr->common.fn_flags & ZEND_ACC_PUBLIC) && intern->ignore_visibility == 0) { + zend_throw_exception_ex(reflection_exception_ptr, 0, + "Trying to invoke %s method %s::%s() from scope %s", + mptr->common.fn_flags & ZEND_ACC_PROTECTED ? "protected" : "private", + ZSTR_VAL(mptr->common.scope->name), ZSTR_VAL(mptr->common.function_name), + ZSTR_VAL(Z_OBJCE_P(getThis())->name)); return; } |