@@ -231,7 +231,14 @@ static void reflection_free_objects_storage(zend_object *object) /* {{{ */
231231 case REF_TYPE_TYPE :
232232 {
233233 type_reference * type_ref = intern -> ptr ;
234- if (ZEND_TYPE_IS_NAME (type_ref -> type )) {
234+ if (ZEND_TYPE_HAS_LIST (type_ref -> type )) {
235+ void * entry ;
236+ ZEND_TYPE_LIST_FOREACH (ZEND_TYPE_LIST (type_ref -> type ), entry ) {
237+ if (ZEND_TYPE_LIST_IS_NAME (entry )) {
238+ zend_string_release (ZEND_TYPE_LIST_GET_NAME (entry ));
239+ }
240+ } ZEND_TYPE_LIST_FOREACH_END ();
241+ } else if (ZEND_TYPE_HAS_NAME (type_ref -> type )) {
235242 zend_string_release (ZEND_TYPE_NAME (type_ref -> type ));
236243 }
237244 efree (type_ref );
@@ -1169,7 +1176,14 @@ static void reflection_type_factory(zend_type type, zval *object, zend_bool lega
11691176
11701177 /* Property types may be resolved during the lifetime of the ReflectionType,
11711178 * so we need to make sure that the strings we reference are not released. */
1172- if (ZEND_TYPE_IS_NAME (type )) {
1179+ if (ZEND_TYPE_HAS_LIST (type )) {
1180+ void * entry ;
1181+ ZEND_TYPE_LIST_FOREACH (ZEND_TYPE_LIST (type ), entry ) {
1182+ if (ZEND_TYPE_LIST_IS_NAME (entry )) {
1183+ zend_string_addref (ZEND_TYPE_LIST_GET_NAME (entry ));
1184+ }
1185+ } ZEND_TYPE_LIST_FOREACH_END ();
1186+ } else if (ZEND_TYPE_HAS_NAME (type )) {
11731187 zend_string_addref (ZEND_TYPE_NAME (type ));
11741188 }
11751189}
@@ -6535,7 +6549,7 @@ static const zend_function_entry reflection_named_type_functions[] = {
65356549};
65366550
65376551static const zend_function_entry reflection_union_type_functions [] = {
6538- ZEND_ME (reflection_union_type , getTypes , arginfo_reflection__void , 0 )
6552+ ZEND_ME (reflection_union_type , getTypes , arginfo_class_ReflectionUnionType_getTypes , 0 )
65396553 PHP_FE_END
65406554};
65416555
0 commit comments