1--TEST-- 2Test assignment to typed reference with weak type conversion 3--FILE-- 4<?php 5 6class Test { 7 public string $x = "x"; 8} 9 10$test = new Test; 11var_dump($test); 12$y = "y"; 13$test->x = &$y; 14var_dump($y, $test); 15 16$z = 42; 17$y = $z; 18var_dump($y, $z, $test); 19 20?> 21--EXPECT-- 22object(Test)#1 (1) { 23 ["x"]=> 24 string(1) "x" 25} 26string(1) "y" 27object(Test)#1 (1) { 28 ["x"]=> 29 &string(1) "y" 30} 31string(2) "42" 32int(42) 33object(Test)#1 (1) { 34 ["x"]=> 35 &string(2) "42" 36} 37