summaryrefslogtreecommitdiff
path: root/zend/classimpl.cpp
diff options
context:
space:
mode:
authorvalmat <ufabiz@gmail.com>2014-06-23 20:16:58 +0600
committervalmat <ufabiz@gmail.com>2014-06-23 20:16:58 +0600
commit80e9566d52a682b011e38083fbe18f233298f03e (patch)
tree7fb2c95d91e9319fdd08769e6e2840b94aaa0e6c /zend/classimpl.cpp
parentca60a32c601fe9b0236d3d4717c7b94368a3c172 (diff)
Fixed issue #100
Diffstat (limited to 'zend/classimpl.cpp')
-rw-r--r--zend/classimpl.cpp23
1 files changed, 17 insertions, 6 deletions
diff --git a/zend/classimpl.cpp b/zend/classimpl.cpp
index ca75c5e..23c39cf 100644
--- a/zend/classimpl.cpp
+++ b/zend/classimpl.cpp
@@ -1382,14 +1382,25 @@ void ClassImpl::initialize(ClassBase *base, const std::string &prefix TSRMLS_DC)
if (_parent)
{
// check if the base class was already defined
- if (_parent->_entry) entry.parent = _parent->_entry;
-
+ if (_parent->_entry)
+ {
+ // register the class
+ _entry = zend_register_internal_class_ex(&entry, _parent->_entry, const_cast<char*>(_parent->name().c_str()) TSRMLS_CC);
+ }
+
// otherwise an error is reported
- else std::cerr << "Derived class " << name() << " is initialized before base class " << _parent->name() << ": base class is ignored" << std::endl;
+ else
+ {
+ std::cerr << "Derived class " << name() << " is initialized before base class " << _parent->name() << ": base class is ignored" << std::endl;
+ // register the class
+ _entry = zend_register_internal_class(&entry TSRMLS_CC);
+ }
+ }
+ else
+ {
+ // register the class
+ _entry = zend_register_internal_class(&entry TSRMLS_CC);
}
-
- // register the class
- _entry = zend_register_internal_class(&entry TSRMLS_CC);
// register the classes
for (auto &interface : _interfaces)