summaryrefslogtreecommitdiff
path: root/Zend/tests/return_types/inheritance001.phpt
blob: 8e0523eb7045dcf9d6d692356246064ee566338b (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(): StdClass must be compatible with A::foo(): A in %s on line %d