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