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-- 26Notice: Only variables should be assigned by reference in %s on line 13 27string(8) "original" 28string(7) "changed" 29