diff options
author | Jani Taskinen <jani@php.net> | 2007-11-05 11:43:31 +0000 |
---|---|---|
committer | Jani Taskinen <jani@php.net> | 2007-11-05 11:43:31 +0000 |
commit | 129c125f7f54952143151fa05e61defc9da104f0 (patch) | |
tree | 78fa9802875e4ecfb85232249c5cf4b867e72c5a /Zend/zend_API.c | |
parent | ba9c241e6656853f2753ca5aa38188250140ca86 (diff) | |
download | php-git-129c125f7f54952143151fa05e61defc9da104f0.tar.gz |
- Fix confusing logic (sync with HEAD)
Diffstat (limited to 'Zend/zend_API.c')
-rw-r--r-- | Zend/zend_API.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/Zend/zend_API.c b/Zend/zend_API.c index 97b86f3f34..68bbfee8d3 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -2466,11 +2466,17 @@ ZEND_API zend_bool zend_is_callable_ex(zval *callable, uint check_flags, char ** } lcname = zend_str_tolower_dup(Z_STRVAL_PP(obj), Z_STRLEN_PP(obj)); - if (Z_STRLEN_PP(obj) == sizeof("self") - 1 && memcmp(lcname, "self", sizeof("self")-1) == 0 && EG(active_op_array)) { + + if (EG(active_op_array) && + Z_STRLEN_PP(obj) == sizeof("self") - 1 && + !memcmp(lcname, "self", sizeof("self") - 1)) { ce = EG(active_op_array)->scope; - } else if (Z_STRLEN_PP(obj) == sizeof("parent") - 1 && memcmp(lcname, "parent", sizeof("parent")-1) == 0 && EG(active_op_array) && EG(active_op_array)->scope) { + } else if (EG(active_op_array) && EG(active_op_array)->scope && + Z_STRLEN_PP(obj) == sizeof("parent") - 1 && + !memcmp(lcname, "parent", sizeof("parent") - 1)) { ce = EG(active_op_array)->scope->parent; - } else if (Z_STRLEN_PP(obj) == sizeof("static")-1 && !memcmp(lcname, "static", sizeof("static")-1)) { + } else if (Z_STRLEN_PP(obj) == sizeof("static") - 1 && + !memcmp(lcname, "static", sizeof("static") - 1)) { ce = EG(called_scope); } else if (zend_lookup_class(Z_STRVAL_PP(obj), Z_STRLEN_PP(obj), &pce TSRMLS_CC) == SUCCESS) { ce = *pce; |