1--TEST-- 2Returning a reference from a function. 3--FILE-- 4<?php 5function &returnRef() { 6 global $a; 7 return $a; 8} 9 10function returnVal() { 11 global $a; 12 return $a; 13} 14 15$a = "original"; 16$b =& returnVal(); 17$b = "changed"; 18var_dump($a); //expecting warning + "original" 19 20$a = "original"; 21$b =& returnRef(); 22$b = "changed"; 23var_dump($a); //expecting "changed" 24?> 25--EXPECTF-- 26 27Strict Standards: Only variables should be assigned by reference in %s on line 13 28string(8) "original" 29string(7) "changed" 30