1--TEST--
2Replacing union type by intersection type
3--FILE--
4<?php
5
6interface X {}
7interface Y {}
8interface Z {}
9
10class A {
11    public function test(): X|Z {}
12}
13class B extends A {
14    public function test(): (X&Y)|Z {}
15}
16
17?>
18===DONE===
19--EXPECT--
20===DONE===
21