Home

What will be the output of the following code?



<?php
$foo = 'Bob';
$bar = &$foo;
$bar = "My name is $bar";
echo $bar;
echo $foo;
?>

A.

Error


B.

My name is BobBob


C.

My name is BobMy name is Bob


D.

My name is Bob Bob


You can do it
  1. What will be the output of the following PHP code ? <?php $color = red;$color = green;echo $color;?>…
  2. What will be the output of the following PHP code ? <?php define('GOOD_OCTAL', 0700);define('BAD_OCTAL',…
  3. What will be the output of the following PHP code ? <?php define(GREETING, PHP is a scripting language,…
  4. What will be the output of the following PHP code ? <?php define('IF', 42);echo IF: , IF;?>
  5. What will be the output of the following PHP code? <?php $age = array(Peter=>35, Ben=>37, Joe=>43);print_r(array_change_key_case($age,…
  6. What will be the output of the following PHP code? <?php $a = array(A, Cat, Dog, A, Dog);print_r(array_count_values($a));?>…
  7. What will be the output of the following PHP code? <?php echo (checkdate(4,31,2010) ? 'Valid' : 'Invalid');?>…
  8. What will be the output of the following PHP code ? <?php define('GREETING_TEST', 'PHP is a scripting…
  9. What will be the output of the following PHP code ? <?php $i = 2;while (++$i){ while (--$i > 0) print…
  10. What will be the output of the following code?<?php $foo = 'Bob'; $bar = &$foo; $bar…
  11. The date() function returns ___ representation of the current date and/or time.
  12. What will be the output of the following PHP code? <?php $a1 = array(red, green);$a2 = array(blue,…
  13. What will be the output of the following code? If say date is 22/06/2013. <?php echo Today is .date(F…
  14. How many ways can a session data be stored?
  15. What will be the output of the following PHP code ? <?php $i = 0;while ($i = 10){ print hi;}print…
  16. What will be the output of the following PHP code ? <?php $color1 = red;$color2 = green;echo $color1…
  17. What will be the output of the following PHP code ? <?php $color1 = red;$color2 = 1;echo $color1…
  18. What is the default number of seconds that cached session pages are made available before the new pages…
  19. What will be the output of the following PHP code ? <?php define(NEW_GOOD_NAME_CONSTANT, I have a…
  20. What will be the output of the following PHP code ? <?php $color1 = red;$color2 = green;echo $color1…
  21. What will be the output of the following PHP code ? <?php $i = 0;while ((--$i > ++$i) - 1){ print…
  22. What will be the output of the following PHP code? <?php $cars = array(Volvo, BMW, Toyota, Honda,…
  23. Which of the following PHP statements will output Hello World on the screen?i) echo (“Hello World”);ii)…
  24. What will be the output of the following PHP code? If say date is 22/06/2013. <?php printf( date(t)…
  25. PHP files have a default file extension of..
  26. What will be the output of the following PHP code? <?php $a1 = array_fill(3, 4, blue);$b1 = array_fill(0,…
  27. What will be the output of the following PHP code ? <?php $i = ;while ($i = 10){ print hi;}print…
  28. What will be the output of the following PHP code ? <?php $i = 5;while (--$i > 0 || ++$i){ print…
  29. What will be the output of the following PHP code? <?php $a = array(red, green, blue);array_pop($a);print_r($a);?>…
  30. Which of the following is/are a PHP code editor?i) Notepadii) Notepad++iii) Adobe Dreamweaveriv) PDT