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 21echo get_class(Bar::test()); 22 23?> 24--EXPECT-- 25B 26