blob: af1738f80769241e316052bdd8439d731dbeb0a1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
--TEST--
Inheritance Hinting Compile Checking Failure Internal Classes
--INI--
opcache.enable_cli=1
--FILE--
<?php
class Foo {
public static function test() : Traversable {
return new ArrayIterator([1, 2]);
}
}
class Bar extends Foo {
public static function test() : ArrayObject {
return new ArrayObject([1, 2]);
}
}
--EXPECTF--
Fatal error: Declaration of Bar::test(): ArrayObject must be compatible with Foo::test(): Traversable in %sinheritance007.php on line 12
|