@@ -231,7 +231,14 @@ static void reflection_free_objects_storage(zend_object *object) /* {{{ */
231
231
case REF_TYPE_TYPE :
232
232
{
233
233
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 )) {
235
242
zend_string_release (ZEND_TYPE_NAME (type_ref -> type ));
236
243
}
237
244
efree (type_ref );
@@ -1169,7 +1176,14 @@ static void reflection_type_factory(zend_type type, zval *object, zend_bool lega
1169
1176
1170
1177
/* Property types may be resolved during the lifetime of the ReflectionType,
1171
1178
* 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 )) {
1173
1187
zend_string_addref (ZEND_TYPE_NAME (type ));
1174
1188
}
1175
1189
}
@@ -6535,7 +6549,7 @@ static const zend_function_entry reflection_named_type_functions[] = {
6535
6549
};
6536
6550
6537
6551
static 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 )
6539
6553
PHP_FE_END
6540
6554
};
6541
6555
0 commit comments