From 53e527ad433db13c31e52a9bf5f598aa92c9ab98 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Thu, 6 Feb 2020 10:51:45 +0100 Subject: Remove ZEND_ACC_IMPLEMENT_INTERFACES flag This is equivalent to checking ce->num_interfaces. The only subtle moment is during inheritance, where num_interface may change when parent interfaces are inherited. The check in zend_do_link_class thus uses "interfaces", not "ce->num_interfaces". --- Zend/zend_inheritance.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Zend/zend_inheritance.c') diff --git a/Zend/zend_inheritance.c b/Zend/zend_inheritance.c index a381fced2d..5abe1c55d4 100644 --- a/Zend/zend_inheritance.c +++ b/Zend/zend_inheritance.c @@ -1161,7 +1161,7 @@ ZEND_API void zend_do_inheritance_ex(zend_class_entry *ce, zend_class_entry *par /* Inherit interfaces */ if (parent_ce->num_interfaces) { - if (!(ce->ce_flags & ZEND_ACC_IMPLEMENT_INTERFACES)) { + if (!ce->num_interfaces) { zend_do_inherit_interfaces(ce, parent_ce); } else { uint32_t i; @@ -2463,7 +2463,7 @@ ZEND_API int zend_do_link_class(zend_class_entry *ce, zend_string *lc_parent_nam if (ce->num_traits) { zend_do_bind_traits(ce); } - if (ce->ce_flags & ZEND_ACC_IMPLEMENT_INTERFACES) { + if (interfaces) { zend_do_implement_interfaces(ce, interfaces); } if ((ce->ce_flags & (ZEND_ACC_IMPLICIT_ABSTRACT_CLASS|ZEND_ACC_INTERFACE|ZEND_ACC_TRAIT|ZEND_ACC_EXPLICIT_ABSTRACT_CLASS)) == ZEND_ACC_IMPLICIT_ABSTRACT_CLASS) { -- cgit v1.2.1