zend_error_noreturn(E_COMPILE_ERROR, "Internal Zend error - Missing class information for %s", Z_STRVAL_P(op1));
return NULL;
}
-
+
if (ce->ce_flags & ZEND_ACC_ANON_BOUND) {
- return ce;
+ return ce;
}
-
+
ce->refcount++;
-
+
if (zend_hash_add_ptr(class_table, Z_STR_P(op2), ce) == NULL) {
ce->refcount--;
zend_error_noreturn(E_COMPILE_ERROR, "Cannot declare %s %s, because the name is already in use", zend_get_object_type(ce), ce->name->val);
}
- /* Reuse anonymous bound class */
- if (ce->ce_flags & ZEND_ACC_ANON_BOUND) {
- return ce;
- }
+ /* Reuse anonymous bound class */
+ if (ce->ce_flags & ZEND_ACC_ANON_BOUND) {
+ return ce;
+ }
- zend_do_inheritance(ce, parent_ce TSRMLS_CC);
+ zend_do_inheritance(ce, parent_ce TSRMLS_CC);
ce->refcount++;
class_node.op_type = IS_CONST;
ZVAL_STR(&class_node.u.constant, zend_resolve_class_name_ast(class_ast));
} else if (class_ast->kind == ZEND_AST_CLASS) {
- zend_class_entry *ce =
+ zend_class_entry *ce =
zend_compile_class_decl(class_ast TSRMLS_CC);
zend_string *name = ce->name;
uint32_t fetch_type = zend_get_class_fetch_type(name);
zend_op *opline;
znode declare_node, extends_node;
zend_class_entry *active = CG(active_class_entry);
-
+
if (decl->flags & ZEND_ACC_ANON_CLASS) {
- name = zend_generate_anon_class_name();
+ name = zend_generate_anon_class_name();
- /* do not support serial classes */
- ce->serialize = zend_class_serialize_deny;
- ce->unserialize = zend_class_unserialize_deny;
+ /* Serialization is not supported for anonymous classes */
+ ce->serialize = zend_class_serialize_deny;
+ ce->unserialize = zend_class_unserialize_deny;
+ }
+
+ if (CG(active_class_entry) && !(decl->flags & ZEND_ACC_ANON_CLASS)) {
+ zend_error(E_COMPILE_ERROR, "Class declarations may not be nested");
+ return NULL;
}
-
- if (CG(active_class_entry) && !((decl->flags & ZEND_ACC_ANON_CLASS) == ZEND_ACC_ANON_CLASS)) {
- zend_error(E_COMPILE_ERROR, "Class declarations may not be nested");
- return NULL;
- }
zend_assert_valid_class_name(name);
}
CG(active_class_entry) = active;
-
+
return ce;
}
/* }}} */