xref: /PHP-7.4/Zend/tests/return_types/008.phpt (revision 49a3b03e)
1--TEST--
2Return type covariance in interface implementation
3--FILE--
4<?php
5interface foo {
6    public function bar() : foo;
7}
8
9
10class qux implements foo {
11    public function bar() : qux {
12        return $this;
13    }
14}
15
16$qux = new qux();
17echo get_class($qux->bar());
18
19?>
20--EXPECT--
21qux
22