1--TEST--
2GH-10168: Assign prop with prop ref
3--FILE--
4<?php
5
6class Box {
7    public ?Test $value;
8}
9
10class Test {
11    static ?Test $test;
12
13    function __destruct() {
14        global $box;
15        $box->value = null;
16    }
17}
18
19function test($box) {
20    var_dump($box->value = new Test);
21}
22
23$box = new Box();
24$box->value = new Test;
25Test::$test = &$box->value;
26test($box);
27// Second call tests the cache slot path
28test($box);
29
30?>
31--EXPECT--
32object(Test)#3 (0) {
33}
34object(Test)#3 (0) {
35}
36