Sail E0 Webinar
Question
What will be the output of the following code?
< ?php
$foo = 'Bob';
$bar = &$foo;
$bar = "My name is $bar";
echo $bar;
echo $foo;
?>
Options:
A .  Error
B .  My name is BobBob
C .  My name is BobMy name is Bob
D .  My name is Bob Bob
Answer: Option C


The $bar = &$foo; line will reference $foo via $bar.



Was this answer helpful ?
Next Question

Submit Solution

Your email address will not be published. Required fields are marked *

Latest Videos

Latest Test Papers