summaryrefslogtreecommitdiff
path: root/Zend/zend_builtin_functions.c
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2018-09-19 09:38:17 +0200
committerNikita Popov <nikita.ppv@gmail.com>2018-09-19 09:39:13 +0200
commitcc1fb02760e95965a6ea1f298d61f510a818caeb (patch)
treebf9d8d565753978b20029bf0fa272fa256abb7b6 /Zend/zend_builtin_functions.c
parent6bf681249f54ab3b67792d9c50f680ba9c6513a4 (diff)
parent294fb83ee84b76479a62e4ed37d5523c1208ad7c (diff)
downloadphp-git-cc1fb02760e95965a6ea1f298d61f510a818caeb.tar.gz
Merge branch 'PHP-7.1' into PHP-7.2
Diffstat (limited to 'Zend/zend_builtin_functions.c')
-rw-r--r--Zend/zend_builtin_functions.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/Zend/zend_builtin_functions.c b/Zend/zend_builtin_functions.c
index 81c78f2a97..8cd0207e46 100644
--- a/Zend/zend_builtin_functions.c
+++ b/Zend/zend_builtin_functions.c
@@ -1294,13 +1294,10 @@ ZEND_FUNCTION(method_exists)
if (zend_hash_exists(&ce->function_table, lcname)) {
zend_string_release(lcname);
RETURN_TRUE;
- } else {
- union _zend_function *func = NULL;
-
- if (Z_TYPE_P(klass) == IS_OBJECT
- && Z_OBJ_HT_P(klass)->get_method != NULL
- && (func = Z_OBJ_HT_P(klass)->get_method(&Z_OBJ_P(klass), method_name, NULL)) != NULL
- ) {
+ } else if (Z_TYPE_P(klass) == IS_OBJECT && Z_OBJ_HT_P(klass)->get_method != NULL) {
+ zend_object *obj = Z_OBJ_P(klass);
+ zend_function *func = Z_OBJ_HT_P(klass)->get_method(&obj, method_name, NULL);
+ if (func != NULL) {
if (func->common.fn_flags & ZEND_ACC_CALL_VIA_TRAMPOLINE) {
/* Returns true to the fake Closure's __invoke */
RETVAL_BOOL(func->common.scope == zend_ce_closure