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 X {}
9
10class Test implements A, B {}
11
12class Foo {
13    public function foo(): (A&B)|X {
14        return new Test();
15    }
16}
17
18/* This fails because just A larger than A&B */
19class FooChild extends Foo {
20    public function foo(): A|X {
21        return new Test();
22    }
23}
24
25?>
26--EXPECTF--
27Fatal error: Declaration of FooChild::foo(): A|X must be compatible with Foo::foo(): (A&B)|X in %s on line %d
28