1--TEST-- 2Co-variance check failure for intersection type where child replace one of intersection type members with a supertype 3--FILE-- 4<?php 5 6interface A {} 7interface B extends A {} 8interface C {} 9 10class Test implements B, C {} 11 12class Foo { 13 public function foo(): B&C { 14 return new Test(); 15 } 16} 17 18/* This fails because A is a parent type for B */ 19class FooChild extends Foo { 20 public function foo(): A&C { 21 return new Test(); 22 } 23} 24 25?> 26--EXPECTF-- 27Fatal error: Declaration of FooChild::foo(): A&C must be compatible with Foo::foo(): B&C in %s on line %d 28