summaryrefslogtreecommitdiff
path: root/Zend/tests/return_types/inheritance005.phpt
blob: 7415a72b9f59163284d05fb499400e7f8f791b59 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
--TEST--
Internal covariant return type of self
--FILE--
<?php
class Foo {
    public static function test() : self {
        return new Foo;
    }
}

class Bar extends Foo {
    public static function test() : self {
        return new Bar;
    }
}
--EXPECTF--
Fatal error: Declaration of Bar::test(): Bar must be compatible with Foo::test(): Foo in %sinheritance005.php on line 12