1--TEST-- 2Co-variance failure for intersection type where child is union, but not all members are a subtype of intersection 1 3--FILE-- 4<?php 5 6interface X {} 7interface Y {} 8 9interface L {} 10 11class TestOne implements X, Y {} 12class TestTwo implements X {} 13 14interface A 15{ 16 public function foo(): (X&Y)|L; 17} 18 19interface B extends A 20{ 21 public function foo(): TestOne|TestTwo; 22} 23 24?> 25--EXPECTF-- 26Fatal error: Declaration of B::foo(): TestOne|TestTwo must be compatible with A::foo(): (X&Y)|L in %s on line %d 27