Sail E0 Webinar

MCQs

Total Questions : 121 | Page 4 of 13 pages
Question 31. What will be the output of the following PHP code ?define("__LINE__", "PHP is a scripting language");echo __LINE__;
  1.    2
  2.    PHP is a scripting language
  3.    ERROR
  4.    __LINE__
 Discuss Question
Answer: Option A. -> 2
Question 32. What will be the output of the following PHP code ?define('IF', 42);echo "IF: ", IF;
  1.    ERROR
  2.    IF:42
  3.    IF:
  4.    No output
 Discuss Question
Answer: Option A. -> ERROR
Question 33. What will be the output of the following PHP code ?define("VAR_NAME","test");${VAR_NAME} = "value";echo VAR_NAME;echo ${VAR_NAME};
  1.    test
  2.    testvalue
  3.    testtest
  4.    error, constant value cannot be changed
 Discuss Question
Answer: Option B. -> testvalue
Question 34. What will be the output of the following PHP code ?define("NEW_GOOD_NAME_CONSTANT", "I have a value");define("OLD_BAD_NAME_CONSTANT", NEW_GOOD_NAME_CONSTANT);echo NEW_GOOD_NAME_CONSTANT;echo OLD_BAD_NAME_CONSTANT;
  1.    I have a valueNEW_GOO_NAME_CONSTANTS
  2.    I have a valueI have a value
  3.    ERROR
  4.    I have a value
 Discuss Question
Answer: Option B. -> I have a valueI have a value
Question 35. What will be the output of the following PHP code ?class myObject { }define('myObject::CONSTANT', 'test');echo myObject::CONSTANT;
  1.    myObject::CONSTANT
  2.    error
  3.    no output
  4.    test
 Discuss Question
Answer: Option B. -> error
Question 36. What will be the output of the following PHP code ?$x = 5;$y = 10;$z = "$x + $y";echo "$z";
  1.    $z
  2.    15
  3.    10 + 5
  4.    $x + $y
 Discuss Question
Answer: Option C. -> 10 + 5
Question 37. What will be the output of the following PHP code ?$x = 4;$y = 3$z = 1;$z = $z + $x + $y;echo "$z";
  1.    8
  2.    1
  3.    15
  4.    $z
 Discuss Question
Answer: Option A. -> 8
Question 38. What will be the output of the following PHP code ?$x = 4;$y = 3;$z = 1;echo "$x = $x + $y + $z";
  1.    4 = 4 + 3 + 1
  2.    Error
  3.    8
  4.    8 = 4 + 3 +1
 Discuss Question
Answer: Option A. -> 4 = 4 + 3 + 1
Question 39. What will be the output of the following PHP code ?$x = 3.3;$y = 2;echo $x % $y;
  1.    0
  2.    2
  3.    Error
  4.    1
 Discuss Question
Answer: Option D. -> 1
Question 40. What will be the output of the following PHP code ?$x = 10;$y = 4;$z = 3;echo $x % $y % $z;
  1.    1
  2.    Error
  3.    0
  4.    2
 Discuss Question
Answer: Option D. -> 2

Latest Videos

Latest Test Papers