Skip to content

Commit

Permalink
Merge branch 'master' of github.com:CopernicaMarketingSoftware/PHP-CPP
Browse files Browse the repository at this point in the history
  • Loading branch information
EmielBruijntjes committed Jun 10, 2022
2 parents 84b262e + ea3e14b commit d52ed96
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions zend/classimpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1366,8 +1366,11 @@ zend_class_entry *ClassImpl::initialize(ClassBase *base, const std::string &pref
// initialize the class entry
INIT_CLASS_ENTRY_EX(entry, _name.c_str(), _name.size(), entries());

// we need a special constructor
entry.create_object = &ClassImpl::createObject;
// we need a special constructor, but only for real classes, not for interfaces.
// (in fact: from php 7.4 onwards the create_object method is part of union
// together with the interface_gets_implemented method, which causes a crash
// when the create_object property is set for an interface)
if (_type != ClassType::Interface) entry.create_object = &ClassImpl::createObject;

// register function that is called for static method calls
entry.get_static_method = &ClassImpl::getStaticMethod;
Expand Down Expand Up @@ -1419,7 +1422,7 @@ zend_class_entry *ClassImpl::initialize(ClassBase *base, const std::string &pref
_entry = zend_register_internal_class(&entry);
}

// register the classes
// register the interfaces
for (auto &interface : _interfaces)
{
// register this interface
Expand Down

0 comments on commit d52ed96

Please sign in to comment.