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

--FILE--
<?php

abstract class A {
    abstract 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