1--TEST--
2Test nullsafe operator on delayed var
3--FILE--
4<?php
5
6class Foo {
7    public ?Bar $bar;
8}
9
10class Bar {
11    public string $baz;
12}
13
14$foo = new Foo();
15
16$foo->bar = null;
17var_dump($foo->bar?->baz);
18
19$bar = new Bar();
20$bar->baz = 'baz';
21$foo->bar = $bar;
22var_dump($foo->bar?->baz);
23
24?>
25--EXPECT--
26NULL
27string(3) "baz"
28