summaryrefslogtreecommitdiff
path: root/ext/reflection/php_reflection.c
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2020-04-17 15:31:57 +0200
committerNikita Popov <nikita.ppv@gmail.com>2020-04-17 15:32:47 +0200
commit08c5c69eff6f0110b373c55ee2246591d14cc82b (patch)
tree7ca58bb40330190795a29586cc1a251e6a4ab338 /ext/reflection/php_reflection.c
parent7352213b386658d5dc987cdf5c975fdf5c0bd563 (diff)
downloadphp-git-08c5c69eff6f0110b373c55ee2246591d14cc82b.tar.gz
Remove ZEND_ACC_DTOR flag
This is only used in reflection, where doing a simple string check is acceptable. I'm also dropping the "dtor" printing in the reflection dump. Dtors are just one of many magic methods, I don't think there's a point in explicitly highlighting them, when the name is already unambiguous.
Diffstat (limited to 'ext/reflection/php_reflection.c')
-rw-r--r--ext/reflection/php_reflection.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c
index e23f0076a9..552913dd1e 100644
--- a/ext/reflection/php_reflection.c
+++ b/ext/reflection/php_reflection.c
@@ -767,9 +767,6 @@ static void _function_string(smart_str *str, zend_function *fptr, zend_class_ent
if (fptr->common.fn_flags & ZEND_ACC_CTOR) {
smart_str_appends(str, ", ctor");
}
- if (fptr->common.fn_flags & ZEND_ACC_DTOR) {
- smart_str_appends(str, ", dtor");
- }
smart_str_appends(str, "> ");
if (fptr->common.fn_flags & ZEND_ACC_ABSTRACT) {
@@ -3341,7 +3338,7 @@ ZEND_METHOD(ReflectionMethod, isConstructor)
/* }}} */
/* {{{ proto public bool ReflectionMethod::isDestructor()
- Returns whether this method is static */
+ Returns whether this method is a destructor */
ZEND_METHOD(ReflectionMethod, isDestructor)
{
reflection_object *intern;
@@ -3351,7 +3348,8 @@ ZEND_METHOD(ReflectionMethod, isDestructor)
RETURN_THROWS();
}
GET_REFLECTION_OBJECT_PTR(mptr);
- RETURN_BOOL(mptr->common.fn_flags & ZEND_ACC_DTOR);
+ RETURN_BOOL(zend_string_equals_literal_ci(
+ mptr->common.function_name, ZEND_DESTRUCTOR_FUNC_NAME));
}
/* }}} */