Skip to content

Commit 6c0d07e

Browse files
committed
Fix redundent type checks with composite types
1 parent 222c6c9 commit 6c0d07e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Zend/zend_compile.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6335,6 +6335,9 @@ static zend_type zend_compile_typename(
63356335

63366336
/* Check for trivially redundant class types */
63376337
for (size_t i = 0; i < type_list->num_types - 1; i++) {
6338+
if (ZEND_TYPE_IS_INTERSECTION(type_list->types[i])) {
6339+
continue;
6340+
}
63386341
if (zend_string_equals_ci(
63396342
ZEND_TYPE_NAME(type_list->types[i]), ZEND_TYPE_NAME(single_type))) {
63406343
zend_string *single_type_str = zend_type_to_string(single_type);

0 commit comments

Comments
 (0)