1--TEST--
2External covariant return type of self
3--INI--
4opcache.enable_cli=1
5--FILE--
6<?php
7require __DIR__ . "/classes.php.inc";
8
9class Foo {
10    public static function test() : A {
11        return new A;
12    }
13}
14
15class Bar extends Foo {
16    public static function test() : B {
17        return new B;
18    }
19}
20--EXPECTF--
21Fatal error: Declaration of Bar::test(): B must be compatible with Foo::test(): A in %sinheritance006.php on line 14
22