Lines Matching refs:parent_ce

804 ZEND_API void zend_do_inheritance(zend_class_entry *ce, zend_class_entry *parent_ce) /* {{{ */  in zend_do_inheritance()  argument
812 if (UNEXPECTED(!(parent_ce->ce_flags & ZEND_ACC_INTERFACE))) { in zend_do_inheritance()
813 …OR, "Interface %s may not inherit from class (%s)", ZSTR_VAL(ce->name), ZSTR_VAL(parent_ce->name)); in zend_do_inheritance()
815 } else if (UNEXPECTED(parent_ce->ce_flags & (ZEND_ACC_INTERFACE|ZEND_ACC_TRAIT|ZEND_ACC_FINAL))) { in zend_do_inheritance()
817 if (parent_ce->ce_flags & ZEND_ACC_INTERFACE) { in zend_do_inheritance()
818 …_ERROR, "Class %s cannot extend from interface %s", ZSTR_VAL(ce->name), ZSTR_VAL(parent_ce->name)); in zend_do_inheritance()
819 } else if (parent_ce->ce_flags & ZEND_ACC_TRAIT) { in zend_do_inheritance()
820 …PILE_ERROR, "Class %s cannot extend from trait %s", ZSTR_VAL(ce->name), ZSTR_VAL(parent_ce->name)); in zend_do_inheritance()
824 if (parent_ce->ce_flags & ZEND_ACC_FINAL) { in zend_do_inheritance()
825 …, "Class %s may not inherit from final class (%s)", ZSTR_VAL(ce->name), ZSTR_VAL(parent_ce->name)); in zend_do_inheritance()
829 ce->parent = parent_ce; in zend_do_inheritance()
832 zend_do_inherit_interfaces(ce, parent_ce); in zend_do_inheritance()
835 if (parent_ce->default_properties_count) { in zend_do_inheritance()
839 …zval *table = pemalloc(sizeof(zval) * (ce->default_properties_count + parent_ce->default_propertie… in zend_do_inheritance()
841 end = table + parent_ce->default_properties_count; in zend_do_inheritance()
852 …end = pemalloc(sizeof(zval) * parent_ce->default_properties_count, ce->type == ZEND_INTERNAL_CLASS… in zend_do_inheritance()
853 dst = end + parent_ce->default_properties_count; in zend_do_inheritance()
856 src = parent_ce->default_properties_table + parent_ce->default_properties_count; in zend_do_inheritance()
861 if (parent_ce->type != ce->type) { in zend_do_inheritance()
875 ce->default_properties_count += parent_ce->default_properties_count; in zend_do_inheritance()
878 if (parent_ce->default_static_members_count) { in zend_do_inheritance()
882 …zval *table = pemalloc(sizeof(zval) * (ce->default_static_members_count + parent_ce->default_stati… in zend_do_inheritance()
884 end = table + parent_ce->default_static_members_count; in zend_do_inheritance()
895 …end = pemalloc(sizeof(zval) * parent_ce->default_static_members_count, ce->type == ZEND_INTERNAL_C… in zend_do_inheritance()
896 dst = end + parent_ce->default_static_members_count; in zend_do_inheritance()
899 src = parent_ce->default_static_members_table + parent_ce->default_static_members_count; in zend_do_inheritance()
903 if (parent_ce->type == ZEND_INTERNAL_CLASS) { in zend_do_inheritance()
916 ce->default_static_members_count += parent_ce->default_static_members_count; in zend_do_inheritance()
927 property_info->offset += parent_ce->default_static_members_count; in zend_do_inheritance()
929 property_info->offset += parent_ce->default_properties_count * sizeof(zval); in zend_do_inheritance()
934 if (zend_hash_num_elements(&parent_ce->properties_info)) { in zend_do_inheritance()
937 zend_hash_num_elements(&parent_ce->properties_info), 0); in zend_do_inheritance()
939 ZEND_HASH_FOREACH_STR_KEY_PTR(&parent_ce->properties_info, key, property_info) { in zend_do_inheritance()
944 if (zend_hash_num_elements(&parent_ce->constants_table)) { in zend_do_inheritance()
949 zend_hash_num_elements(&parent_ce->constants_table), 0); in zend_do_inheritance()
951 ZEND_HASH_FOREACH_STR_KEY_PTR(&parent_ce->constants_table, key, c) { in zend_do_inheritance()
956 if (zend_hash_num_elements(&parent_ce->function_table)) { in zend_do_inheritance()
959 zend_hash_num_elements(&parent_ce->function_table), 0); in zend_do_inheritance()
961 ZEND_HASH_FOREACH_STR_KEY_PTR(&parent_ce->function_table, key, func) { in zend_do_inheritance()
978 ce->ce_flags |= parent_ce->ce_flags & (ZEND_HAS_STATIC_IN_METHODS | ZEND_ACC_USE_GUARDS); in zend_do_inheritance()