}
}
if (dtor) {
- dtor->common.fn_flags |= ZEND_ACC_DTOR;
if (dtor->common.fn_flags & ZEND_ACC_STATIC) {
zend_error(error_type, "Destructor %s::%s() cannot be static", ZSTR_VAL(scope->name), ZSTR_VAL(dtor->common.function_name));
}
}
}
if (ce->destructor) {
- ce->destructor->common.fn_flags |= ZEND_ACC_DTOR;
if (ce->destructor->common.fn_flags & ZEND_ACC_STATIC) {
zend_error_noreturn(E_COMPILE_ERROR, "Destructor %s::%s() cannot be static",
ZSTR_VAL(ce->name), ZSTR_VAL(ce->destructor->common.function_name));
/* Whether this class was used in its unlinked state. | | | */
#define ZEND_ACC_HAS_UNLINKED_USES (1 << 23) /* X | | | */
/* | | | */
-/* Function Flags (unused: 17, 23, 26) | | | */
+/* Function Flags (unused: 17, 23, 26, 29) | | | */
/* ============== | | | */
/* | | | */
/* deprecation flag | | | */
/* functions is a constructor | | | */
#define ZEND_ACC_CTOR (1 << 28) /* | X | | */
/* | | | */
-/* function is a destructor | | | */
-#define ZEND_ACC_DTOR (1 << 29) /* | X | | */
-/* | | | */
/* closure uses $this | | | */
#define ZEND_ACC_USES_THIS (1 << 30) /* | X | | */
/* | | | */
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) {
/* }}} */
/* {{{ 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;
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));
}
/* }}} */
Reflecting on method TestClass::__destruct()
__toString():
-string(%d) "Method [ <user, dtor> public method __destruct ] {
+string(%d) "Method [ <user> public method __destruct ] {
@@ %s 28 - 28
}
"