Eugene Posted October 7, 2006 Share Posted October 7, 2006 $somevariable = "test";$somevariable =& "test";What's the difference? Why is there an "&" symbol? Link to comment https://forums.phpfreaks.com/topic/23243-what-does/ Share on other sites More sharing options...
Eugene Posted October 7, 2006 Author Share Posted October 7, 2006 Bump. Link to comment https://forums.phpfreaks.com/topic/23243-what-does/#findComment-105381 Share on other sites More sharing options...
extrovertive Posted October 7, 2006 Share Posted October 7, 2006 & = a reference pointer operator in PHP[code=php:0]$somevariable = "test";$newvariable = &$somevariable;echo $newvariable . "<br />";$somevariable = "test2";echo $newvariable;[/code]That mean, whenever $somevariable changes, $newvariable also changes since it references $somevariable.Try that code.And then try ouputting thae code taking the & out. Link to comment https://forums.phpfreaks.com/topic/23243-what-does/#findComment-105383 Share on other sites More sharing options...
Eugene Posted October 7, 2006 Author Share Posted October 7, 2006 Oh that's neat. Link to comment https://forums.phpfreaks.com/topic/23243-what-does/#findComment-105386 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.