We can see that the original value has been modified. It occurs after being referenced and assigned a value. However, before being assigned a value, the original variable will not change.
We can see that the original value has been modified. It occurs after being referenced and assigned a value. However, before being assigned a value, the original variable will not change.
The Code is as follows:
$ Foo = 'bob'; // assign 'bob' to $ foo.
$ Bar = & $ foo; // reference $ foo through $ bar
Echo $ foo .'
';
$ Bar = "My name is $ bar"; // modify the $ bar variable.
Echo $ bar .'
';
Echo $ foo .'
'; // The value of $ foo is also modified.
?>
Output:
Bob
My name is Bob
My name is Bob
We can see that the original value is indeed modified, after being referenced and assigned a value, but before being assigned a value, the original variable will not change.