Eugene Posted October 7, 2006 Share Posted October 7, 2006 $somevariable = "test";$somevariable =& "test";What's the difference? Why is there an "&" symbol? Quote Link to comment Share on other sites More sharing options...
Eugene Posted October 7, 2006 Author Share Posted October 7, 2006 Bump. Quote Link to comment 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. Quote Link to comment Share on other sites More sharing options...
Eugene Posted October 7, 2006 Author Share Posted October 7, 2006 Oh that's neat. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.