From 89b2d88659b8a561769f51dfab1fa325e7fc0603 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Fri, 24 May 2019 14:28:44 +0200 Subject: Register class before fetching parent We want the class declaration to be available while compiling the parent class. --- Zend/zend_inheritance.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'Zend/zend_inheritance.c') diff --git a/Zend/zend_inheritance.c b/Zend/zend_inheritance.c index 8541a22df0..738e528308 100644 --- a/Zend/zend_inheritance.c +++ b/Zend/zend_inheritance.c @@ -2130,10 +2130,11 @@ void zend_verify_abstract_class(zend_class_entry *ce) /* {{{ */ } /* }}} */ -ZEND_API void zend_do_link_class(zend_class_entry *ce, zend_class_entry *parent) /* {{{ */ +ZEND_API void zend_do_link_class(zend_class_entry *ce) /* {{{ */ { ce->ce_flags |= ZEND_ACC_LINKING_IN_PROGRESS; - if (parent) { + if (ce->parent_name) { + zend_class_entry *parent = zend_fetch_class_by_name(ce->parent_name, NULL, 0); zend_do_inheritance(ce, parent); } if (ce->ce_flags & ZEND_ACC_IMPLEMENT_TRAITS) { -- cgit v1.2.1