Jump to content

What does?


Eugene

Recommended Posts

& = 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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.