blob: 47e79fa6b37b65abb4593df526947bda3be812d2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
--TEST--
iterable type#004 - Parameter covariance
--FILE--
<?php
class Foo {
function testArray(array $array) {}
function testTraversable(Traversable $traversable) {}
function testScalar(int $int) {}
}
class Bar extends Foo {
function testArray(iterable $iterable) {}
function testTraversable(iterable $iterable) {}
function testScalar(iterable $iterable) {}
}
?>
--EXPECTF--
Warning: Declaration of Bar::testScalar(iterable $iterable) should be compatible with Foo::testScalar(int $int) in %s on line %d
|