summaryrefslogtreecommitdiff
path: root/Zend/tests/return_types/inheritance001.phpt
blob: ce33d97995e53e42585ffd2fc1d00542c3e0fd39 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
--TEST--
Return type covariance; extends class

--FILE--
<?php

class A {
    function foo(): A {}
}

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

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