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


Please do not use chat terms. Example: avoid using "grt" instead of "great".

You can do it
  1. Which one of the following format parameter can be used to identify timezone?
  2. What will be the output of the following PHP code ? <?php /*echo Hello world;*/ ?>
  3. What will be the output of the following PHP code? <?php $a = array(A, Cat, Dog, A, Dog);print_r(array_count_values($a));?>…
  4. What will be the output of the following PHP code ? <?php define(VAR_NAME,test);${VAR_NAME} = value;echo…
  5. Which of the following is/are a PHP code editor?i) Notepadii) Notepad++iii) Adobe Dreamweaveriv) PDT
  6. What will be the output of the following PHP code ? <?php define(NEW_GOOD_NAME_CONSTANT, I have a…
  7. The date() function returns ___ representation of the current date and/or time.
  8. What will be the output of the following PHP code ? <?php class Constants{ define('MIN_VALUE', '0.0');define('MAX_VALUE',…
  9. What will be the output of the following PHP code ? <?php define(GREETING, PHP is a scripting language);echo…
  10. What is the default time(in seconds) for which session data is considered valid?
  11. What will be the output of the following PHP code ? <?php define(__LINE__, PHP is a scripting language);echo…
  12. If the directive session.cookie_lifetime is set to 3600, the cookie will live until..
  13. A PHP script should start with ___ and end with ___:
  14. Which one of the following is the default PHP session name?
  15. What will be the output of the following PHP code? <?php $a1 = array_fill(3, 4, blue);$b1 = array_fill(0,…
  16. What will be the output of the following PHP code ? <?php $color1 = red;$color2 = 1;echo $color1…
  17. What will be the output of the following PHP code? <?php $fname = array(Peter, Ben, Joe);$age = array(35,…
  18. What will be the output of the following PHP code ? <?php $color1 = red;$color2 = red;echo $color1…
  19. Which of the following PHP statements will output Hello World on the screen?i) echo (“Hello World”);ii)…
  20. Which one of the following function is useful for producing a timestamp based on a given date and time.
  21. If the format is F then which one of the following will be returned?
  22. What will be the output of the following PHP code? <?php echo (checkdate(4,31,2010) ? 'Valid' : 'Invalid');?>…
  23. What does PHP stand for?i) Personal Home Pageii) Hypertext Preprocessoriii) Pretext Hypertext Processoriv)…
  24. What will be the output of the following PHP code ? <?php $color1 = 1;$color2 = 1;echo $color1 +…
  25. What will be the output of the following PHP code ? <?php $i = 5;while (--$i > 0 || ++$i){ print…
  26. Which of following variables can be assigned a value to it?i) $3helloii) $_helloiii) $thisiv) $This
  27. How many ways can a session data be stored?
  28. What will be the output of the following PHP code ? <?php $color1 = red;$color2 = green;echo $color1…
  29. What will be the output of the following PHP code? <?php $cars = array(Volvo, BMW, Toyota, Honda,…
  30. To create an object and set the date to JUNE 22, 2013, which one of the following statement should be…