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 9class TestOne implements X, Y {} 10class TestTwo implements X {} 11 12interface A 13{ 14 public function foo(): X&Y; 15} 16 17interface B extends A 18{ 19 public function foo(): TestOne|TestTwo; 20} 21 22?> 23--EXPECTF-- 24Fatal error: Declaration of B::foo(): TestOne|TestTwo must be compatible with A::foo(): X&Y in %s on line %d 25