From 7a6fa7f6247d13d4d464a948451866b554721f81 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Fri, 8 Feb 2019 12:20:31 +0100 Subject: Fix refcounting of prop types coming from traits --- Zend/zend_inheritance.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'Zend/zend_inheritance.c') diff --git a/Zend/zend_inheritance.c b/Zend/zend_inheritance.c index acf09629d0..6a66846145 100644 --- a/Zend/zend_inheritance.c +++ b/Zend/zend_inheritance.c @@ -1825,6 +1825,9 @@ static void zend_do_traits_property_binding(zend_class_entry *ce, zend_class_ent Z_TRY_ADDREF_P(prop_value); doc_comment = property_info->doc_comment ? zend_string_copy(property_info->doc_comment) : NULL; + if (ZEND_TYPE_IS_NAME(property_info->type)) { + zend_string_addref(ZEND_TYPE_NAME(property_info->type)); + } zend_declare_typed_property(ce, prop_name, prop_value, flags, doc_comment, property_info->type); zend_string_release_ex(prop_name, 0); } ZEND_HASH_FOREACH_END(); -- cgit v1.2.1