1--TEST-- 2Testing object's variance in inheritance 3--FILE-- 4<?php 5 6interface I1 { 7 function method1(I1 $o): object; 8} 9interface I2 extends I1 { 10 function method1(object $o): I1; 11} 12final class C1 implements I2 { 13 function method1($o = null): self { 14 return $this; 15 } 16} 17 18$o = new C1(); 19echo get_class($o->method1()); 20?> 21--EXPECT-- 22C1 23