summaryrefslogtreecommitdiff
path: root/ext/reflection/php_reflection.c
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2016-04-01 16:17:49 +0300
committerDmitry Stogov <dmitry@zend.com>2016-04-01 16:17:49 +0300
commit7abfaac901684da8bdcbccf43682a5557085c917 (patch)
tree88c9d1a568c3638a070ea21247e8d0213f26d878 /ext/reflection/php_reflection.c
parentc72282a13b12b7e572469eba7a7ce593d900a8a2 (diff)
downloadphp-git-7abfaac901684da8bdcbccf43682a5557085c917.tar.gz
Merge zend_execute_data->called_scope into zend_execute_data->This.
"called_scope" made sense only for static method calls, for dynamic calls it was always equal to the class of $this. Now EG(This) may store IS_OBJECT + $this or IS_UNUSED + "called_scope" (of course, "called_scope" may be NULL). Some code might need to be adopted to support this change. Checks (Z_OBJ(EX(This))) might need to be converted into (Z_TYPE(EX(This)) == IS_OBJECT).
Diffstat (limited to 'ext/reflection/php_reflection.c')
-rw-r--r--ext/reflection/php_reflection.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c
index 68aa136d90..dd3bd6e94d 100644
--- a/ext/reflection/php_reflection.c
+++ b/ext/reflection/php_reflection.c
@@ -88,7 +88,7 @@ ZEND_DECLARE_MODULE_GLOBALS(reflection)
/* Method macros */
#define METHOD_NOTSTATIC(ce) \
- if (!Z_OBJ(EX(This)) || !instanceof_function(Z_OBJCE(EX(This)), ce)) { \
+ if ((Z_TYPE(EX(This)) != IS_OBJECT) || !instanceof_function(Z_OBJCE(EX(This)), ce)) { \
php_error_docref(NULL, E_ERROR, "%s() cannot be called statically", get_active_function_name()); \
return; \
} \
@@ -2316,7 +2316,7 @@ ZEND_METHOD(reflection_generator, getThis)
REFLECTION_CHECK_VALID_GENERATOR(ex)
- if (Z_OBJ(ex->This)) {
+ if (Z_TYPE(ex->This) == IS_OBJECT) {
ZVAL_COPY(return_value, &ex->This);
} else {
ZVAL_NULL(return_value);