summaryrefslogtreecommitdiff
path: root/ext/reflection/php_reflection.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/reflection/php_reflection.c')
-rw-r--r--ext/reflection/php_reflection.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c
index 1e11b8735a..8bfafe7c5a 100644
--- a/ext/reflection/php_reflection.c
+++ b/ext/reflection/php_reflection.c
@@ -485,7 +485,7 @@ static void _class_string(smart_str *str, zend_class_entry *ce, zval *obj, char
size_t len = ZSTR_LEN(mptr->common.function_name);
/* Do not display old-style inherited constructors */
- if (mptr->common.scope->constructor != mptr
+ if ((mptr->common.fn_flags & ZEND_ACC_CTOR) == 0
|| mptr->common.scope == ce
|| !key
|| zend_binary_strcasecmp(ZSTR_VAL(key), ZSTR_LEN(key), ZSTR_VAL(mptr->common.function_name), len) == 0)
@@ -756,10 +756,10 @@ static void _function_string(smart_str *str, zend_function *fptr, zend_class_ent
if (fptr->common.prototype && fptr->common.prototype->common.scope) {
smart_str_append_printf(str, ", prototype %s", ZSTR_VAL(fptr->common.prototype->common.scope->name));
}
- if (fptr->common.scope && fptr->common.scope->constructor == fptr) {
+ if (fptr->common.fn_flags & ZEND_ACC_CTOR) {
smart_str_appends(str, ", ctor");
}
- if (fptr->common.scope && fptr->common.scope->destructor == fptr) {
+ if (fptr->common.fn_flags & ZEND_ACC_DTOR) {
smart_str_appends(str, ", dtor");
}
smart_str_appends(str, "> ");
@@ -3403,7 +3403,7 @@ ZEND_METHOD(reflection_method, isConstructor)
/* we need to check if the ctor is the ctor of the class level we we
* looking at since we might be looking at an inherited old style ctor
* defined in base class. */
- RETURN_BOOL(intern->ce->constructor == mptr);
+ RETURN_BOOL(mptr->common.fn_flags & ZEND_ACC_CTOR && intern->ce->constructor && intern->ce->constructor->common.scope == mptr->common.scope);
}
/* }}} */
@@ -3418,7 +3418,7 @@ ZEND_METHOD(reflection_method, isDestructor)
return;
}
GET_REFLECTION_OBJECT_PTR(mptr);
- RETURN_BOOL(intern->ce->destructor == mptr);
+ RETURN_BOOL(mptr->common.fn_flags & ZEND_ACC_DTOR);
}
/* }}} */