scope->destructor = dtor;
scope->clone = clone;
if (ctor) {
- ctor->common.fn_flags |= ZEND_ACC_CTOR;
+ ctor->common.fn_flags |= ZEND_ACC_CTOR|ZEND_ACC_DYNAMIC;
if (ctor->common.fn_flags & ZEND_ACC_STATIC) {
zend_error(error_type, "Constructor %s::%s cannot be static", ctor->common.scope->name, ctor->common.function_name);
}
}
if (dtor) {
- dtor->common.fn_flags |= ZEND_ACC_DTOR;
+ dtor->common.fn_flags |= ZEND_ACC_DTOR|ZEND_ACC_DYNAMIC;
if (dtor->common.fn_flags & ZEND_ACC_STATIC) {
zend_error(error_type, "Destructor %s::%s cannot be static", dtor->common.scope->name, dtor->common.function_name);
}
}
if (clone) {
- clone->common.fn_flags |= ZEND_ACC_CLONE;
+ clone->common.fn_flags |= ZEND_ACC_CLONE|ZEND_ACC_DYNAMIC;
if (clone->common.fn_flags & ZEND_ACC_STATIC) {
zend_error(error_type, "Constructor %s::%s cannot be static", clone->common.scope->name, clone->common.function_name);
}
do_inherit_parent_constructor(ce);
if (ce->constructor) {
- ce->constructor->common.fn_flags |= ZEND_ACC_CTOR;
+ ce->constructor->common.fn_flags |= ZEND_ACC_CTOR|ZEND_ACC_DYNAMIC;
if (ce->constructor->common.fn_flags & ZEND_ACC_STATIC) {
zend_error(E_COMPILE_ERROR, "Constructor %s::%s() cannot be static", ce->name, ce->constructor->common.function_name);
}
}
if (ce->destructor) {
- ce->destructor->common.fn_flags |= ZEND_ACC_DTOR;
+ ce->destructor->common.fn_flags |= ZEND_ACC_DTOR|ZEND_ACC_DYNAMIC;
if (ce->destructor->common.fn_flags & ZEND_ACC_STATIC) {
zend_error(E_COMPILE_ERROR, "Destructor %s::%s() cannot be static", ce->name, ce->destructor->common.function_name);
}
}
if (ce->clone) {
- ce->clone->common.fn_flags |= ZEND_ACC_CLONE;
+ ce->clone->common.fn_flags |= ZEND_ACC_CLONE|ZEND_ACC_DYNAMIC;
if (ce->clone->common.fn_flags & ZEND_ACC_STATIC) {
zend_error(E_COMPILE_ERROR, "Clone method %s::%s() cannot be static", ce->name, ce->clone->common.function_name);
}
#define ZEND_ACC_ABSTRACT_CLASS 0x10
#define ZEND_ACC_FINAL_CLASS 0x20
+#define ZEND_ACC_DYNAMIC 0x80
+
/* The order of those must be kept - public < protected < private */
#define ZEND_ACC_PUBLIC 0x100
#define ZEND_ACC_PROTECTED 0x200
if (EX(function_state).function->common.scope) {
if (!EG(This) && !(EX(function_state).function->common.fn_flags & ZEND_ACC_STATIC)) {
int severity;
- if (EX(function_state).function->common.fn_flags & (ZEND_ACC_CTOR|ZEND_ACC_DTOR|ZEND_ACC_CLONE)) {
+ if (EX(function_state).function->common.fn_flags & ZEND_ACC_DYNAMIC) {
severity = E_ERROR;
} else {
severity = E_STRICT;
EG(This) = NULL;
if (calling_scope && !(EX(function_state).function->common.fn_flags & ZEND_ACC_STATIC)) {
int severity;
- if (EX(function_state).function->common.fn_flags & (ZEND_ACC_CTOR|ZEND_ACC_DTOR|ZEND_ACC_CLONE)) {
+ if (EX(function_state).function->common.fn_flags & ZEND_ACC_DYNAMIC) {
severity = E_ERROR;
} else {
severity = E_STRICT;