summaryrefslogtreecommitdiff
path: root/ext/reflection/php_reflection.c
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2019-02-14 13:18:45 +0300
committerDmitry Stogov <dmitry@zend.com>2019-02-14 13:18:45 +0300
commit4474cf43e6ba4faa33e66146bfa2859e1094b32f (patch)
tree3307c1abdd2ddd71526fbe5e4ffe2616cfc66e81 /ext/reflection/php_reflection.c
parentad559556b9f138a17f326cbeabcee76fdc732e2f (diff)
parent43a7d95016761787cace63fb52e93e27e123d0cc (diff)
downloadphp-git-4474cf43e6ba4faa33e66146bfa2859e1094b32f.tar.gz
Merge branch 'PHP-7.4'
* PHP-7.4: Fixed bug #77613 (method visibility change) (reverted ZEND_ACC_CTOR and ZEND_ACC_DTOR flags removal)
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 31c9449d06..5fcbef8d20 100644
--- a/ext/reflection/php_reflection.c
+++ b/ext/reflection/php_reflection.c
@@ -482,7 +482,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)
@@ -753,10 +753,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, "> ");
@@ -3396,7 +3396,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);
}
/* }}} */
@@ -3411,7 +3411,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);
}
/* }}} */