1--TEST-- 2Refs on ASSIGN_OBJ fast-path 3--FILE-- 4<?php 5 6function &ref(&$foo) { 7 return $foo; 8} 9 10class Test { 11 public array $prop; 12 public int $prop2; 13 14 public function foo() { 15 $array = []; 16 $ref =& $array; 17 $this->prop = $array; 18 } 19 20 public function bar() { 21 $str = "123"; 22 $this->prop2 = ref($str); 23 } 24} 25 26$test = new Test; 27$test->foo(); 28$test->foo(); 29$test->bar(); 30$test->bar(); 31var_dump($test); 32 33?> 34--EXPECT-- 35object(Test)#1 (2) { 36 ["prop"]=> 37 array(0) { 38 } 39 ["prop2"]=> 40 int(123) 41} 42