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