summaryrefslogtreecommitdiff
path: root/Zend/tests/return_types/009.phpt
blob: 7eda8ce27bc53cb7d1579a3860c35cf8b4e6b77a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
--TEST--
Return type covariance error
--FILE--
<?php
interface foo {
    public function bar() : foo;
}

interface biz {}

class qux implements foo {
    public function bar() : biz {
        return $this;
    }
}
--EXPECTF--
Fatal error: Declaration of qux::bar(): biz must be compatible with foo::bar(): foo in %s on line %d