1--TEST--
2Invalid union type variance: Adding extra return type
3--FILE--
4<?php
5
6class A {
7    public function method(): int {}
8}
9class B extends A {
10    public function method(): int|float {}
11}
12
13?>
14--EXPECTF--
15Fatal error: Declaration of B::method(): int|float must be compatible with A::method(): int in %s on line %d
16