summaryrefslogtreecommitdiff
path: root/Zend/tests/return_types/inheritance003.phpt
blob: 0b22dd55d449fceef396c46ba3433aeb3aa62b79 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
--TEST--
Return type mismatch; implements interface

--FILE--
<?php

interface A {
    function foo(): A;
}

class B implements A {
    function foo(): StdClass {}
}

--EXPECTF--
Fatal error: Declaration of B::foo(): StdClass must be compatible with A::foo(): A in %s on line %d