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