1--TEST--
2Backed property is invariant
3--FILE--
4<?php
5
6class A {
7    public string|int $prop { get => $this->prop; }
8}
9
10class B extends A {
11    public string $prop { get => 'foo'; }
12}
13
14?>
15--EXPECTF--
16Fatal error: Type of B::$prop must be string|int (as in class A) in %s on line %d
17