summaryrefslogtreecommitdiff
path: root/Zend/tests/return_types/inheritance003.phpt
blob: e8ebe90cd125ef3255127d2cb01fd79c6c22f31f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
--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