[PHP]References

개발관련/PHP 2012. 4. 20. 15:31 |
	
		Reference Assignment
	
	
	";
	// returns 1/2

	$a = 1;
	$b =& $a;
	$b = 2;
	echo "a:{$a} / b: {$b}
"; // returns 2/2 unset($b); echo "a:{$a} / b: {$b}
"; ?>


a:1 / b: 2
a:2 / b: 2

( ! ) Notice: Undefined variable: b in D:\wamp\www\php\references.php on line 21
Call Stack
#TimeMemoryFunctionLocation
10.0005672904{main}( )..\references.php:0
a:2 / b: 


'개발관련 > PHP' 카테고리의 다른 글

[PHP]References Returns  (0) 2012.04.20
[PHP]Reference Arguments  (0) 2012.04.20
[PHP]Parent  (0) 2012.04.20
[PHP]Inheritance  (0) 2012.04.20
[PHP]File Write  (0) 2012.04.20
Posted by 파노카페
: