1--TEST--
2iterable type#005 - Return type covariance
3--FILE--
4<?php
5
6class Test {
7    function method(): iterable {
8        return [];
9    }
10}
11
12class TestArray extends Test {
13    function method(): array {
14        return [];
15    }
16}
17
18class TestTraversable extends Test {
19    function method(): Traversable {
20        return new ArrayIterator([]);
21    }
22}
23
24class TestScalar extends Test {
25    function method(): int {
26        return 1;
27    }
28}
29
30?>
31--EXPECTF--
32Fatal error: Declaration of TestScalar::method(): int must be compatible with Test::method(): iterable in %s on line %d
33