@@ -1366,9 +1366,6 @@ zend_class_entry *ClassImpl::initialize(ClassBase *base, const std::string &pref
13661366 // initialize the class entry
13671367 INIT_CLASS_ENTRY_EX (entry, _name.c_str (), _name.size (), entries ());
13681368
1369- // set access types flags for class
1370- _entry->ce_flags |= (int )_type;
1371-
13721369 // we need a special constructor, but only for real classes, not for interfaces.
13731370 // (in fact: from php 7.4 onwards the create_object method is part of union
13741371 // together with the interface_gets_implemented method, which causes a crash
@@ -1424,7 +1421,7 @@ zend_class_entry *ClassImpl::initialize(ClassBase *base, const std::string &pref
14241421 // register the class
14251422 _entry = zend_register_internal_class (&entry);
14261423 }
1427-
1424+
14281425 // register the interfaces
14291426 for (auto &interface : _interfaces)
14301427 {
@@ -1439,6 +1436,9 @@ zend_class_entry *ClassImpl::initialize(ClassBase *base, const std::string &pref
14391436 if (_base->traversable ()) zend_class_implements (_entry, 1 , zend_ce_traversable);
14401437 if (_base->serializable ()) zend_class_implements (_entry, 1 , zend_ce_serializable);
14411438
1439+ // instal the right modifier (to make the class an interface, abstract class, etc)
1440+ _entry->ce_flags |= uint64_t (_type);
1441+
14421442 // this pointer has to be copied to temporary pointer, as &this causes compiler error
14431443 ClassImpl *impl = this ;
14441444
0 commit comments