summaryrefslogtreecommitdiff
path: root/Zend/zend_API.c
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2014-03-05 15:34:50 +0400
committerDmitry Stogov <dmitry@zend.com>2014-03-05 15:34:50 +0400
commit50d899dda3d225c962fec1b8cce1cb880c84999e (patch)
tree40e0d4c71bf8d1070f4e0561d36920f9f571fff5 /Zend/zend_API.c
parentb763baff97b85cead7b6a3cbf904826fb9bb8d16 (diff)
parentef01b7937e334ab454a1ea9b1704d6f981bef801 (diff)
downloadphp-git-50d899dda3d225c962fec1b8cce1cb880c84999e.tar.gz
Merge branch 'refactoring2' of github.com:zendtech/php into refactoring2
Diffstat (limited to 'Zend/zend_API.c')
-rw-r--r--Zend/zend_API.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/Zend/zend_API.c b/Zend/zend_API.c
index 3d116bf333..4362c15178 100644
--- a/Zend/zend_API.c
+++ b/Zend/zend_API.c
@@ -3156,19 +3156,20 @@ ZEND_API zend_bool zend_is_callable_ex(zval *callable, zval *object_ptr, uint ch
if (zend_hash_num_elements(Z_ARRVAL_P(callable)) == 2) {
obj = zend_hash_index_find(Z_ARRVAL_P(callable), 0);
- if (UNEXPECTED(Z_ISREF_P(obj))) {
- obj = Z_REFVAL_P(obj);
- }
method = zend_hash_index_find(Z_ARRVAL_P(callable), 1);
- if (UNEXPECTED(Z_ISREF_P(method))) {
- method = Z_REFVAL_P(method);
- }
}
if (obj && method &&
(Z_TYPE_P(obj) == IS_OBJECT ||
Z_TYPE_P(obj) == IS_STRING) &&
Z_TYPE_P(method) == IS_STRING) {
+ if (UNEXPECTED(Z_ISREF_P(obj))) {
+ obj = Z_REFVAL_P(obj);
+ }
+ if (UNEXPECTED(Z_ISREF_P(method))) {
+ method = Z_REFVAL_P(method);
+ }
+
if (Z_TYPE_P(obj) == IS_STRING) {
if (callable_name) {
char *ptr;
@@ -3235,7 +3236,9 @@ ZEND_API zend_bool zend_is_callable_ex(zval *callable, zval *object_ptr, uint ch
} else {
if (zend_hash_num_elements(Z_ARRVAL_P(callable)) == 2) {
- if (!obj || (Z_TYPE_P(obj) != IS_STRING && Z_TYPE_P(obj) != IS_OBJECT)) {
+ if (!obj || (Z_ISREF_P(obj)?
+ (Z_TYPE_P(Z_REFVAL_P(obj)) != IS_STRING && Z_TYPE_P(Z_REFVAL_P(obj)) != IS_OBJECT) :
+ (Z_TYPE_P(obj) != IS_STRING && Z_TYPE_P(obj) != IS_OBJECT))) {
if (error) zend_spprintf(error, 0, "first array member is not a valid class name or object");
} else {
if (error) zend_spprintf(error, 0, "second array member is not a valid method");