1--TEST--
2Covariant replacement of iterable type with intersection type in DNF type
3--FILE--
4<?php
5
6abstract class MyIterator implements Traversable {}
7
8class Test {
9    function method1(): iterable|string {}
10    function method2(): iterable|int {}
11}
12class Test2 extends Test {
13    function method1(): (X&Traversable)|string {}
14    function method2(): (X&MyIterator)|int {}
15}
16
17?>
18===DONE===
19--EXPECT--
20===DONE===
21