Question
What will be the output of the following code?
< ?php
$foo = 'Bob';
$bar = &$foo;
$bar = "My name is $bar";
echo $bar;
echo $foo;
?>
< ?php
$foo = 'Bob';
$bar = &$foo;
$bar = "My name is $bar";
echo $bar;
echo $foo;
?>
Answer: Option C
Was this answer helpful ?
The $bar = &$foo; line will reference $foo via $bar.
Was this answer helpful ?
Submit Solution