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