1--TEST-- 2Result of assigning to typed reference 3--FILE-- 4<?php 5 6class Test { 7 public ?string $prop; 8} 9function test() { 10 $obj = new Test; 11 $ref =& $obj->prop; 12 var_dump($ref = 0); 13} 14function test2() { 15 $obj = new Test; 16 $ary = []; 17 $ary[0] =& $obj->prop; 18 var_dump($ary[0] = 0); 19} 20test(); 21test2(); 22 23?> 24--EXPECT-- 25string(1) "0" 26string(1) "0" 27