summaryrefslogtreecommitdiff
path: root/Zend/tests/return_types/inheritance007.phpt
blob: 86d0bd9d69a2caf29fe158c0ee18a26c0f75cf45 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
--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