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