Q. What can be the value of case-insensitive parameter in define() function?

  • (A) true
  • (B) false
  • (C) Anything
  • (D) Both A and B
πŸ’¬ Discuss
βœ… Correct Answer: (D) Both A and B

Q. Give an example, how to define a constant array in PHP?

  • (A) const cities = new array(["New Delhi","Mumbai","Banglore"]);
  • (B) define("cities"=["New Delhi","Mumbai","Banglore"]);
  • (C) define("cities", ["New Delhi","Mumbai","Banglore"]);
  • (D) define("cities":["New Delhi","Mumbai","Banglore"]);
πŸ’¬ Discuss
βœ… Correct Answer: (C) define("cities", ["New Delhi","Mumbai","Banglore"]);

Q. What is the scope of a constant in PHP?

  • (A) Local
  • (B) Global
  • (C) Static
  • (D) Fixed
πŸ’¬ Discuss
βœ… Correct Answer: (B) Global

Q. What is name of PHP "===" operator?

  • (A) Equal
  • (B) Safe Equal
  • (C) Identity
  • (D) Identical
πŸ’¬ Discuss
βœ… Correct Answer: (D) Identical

Q. What will be the output of the following PHP code?

Code:
<?php
$a = 123;
$b = "123";

var_dump($a !== $b); 
?>
  • (A) Error
  • (B) bool(false)
  • (C) bool(true)
  • (D) true
πŸ’¬ Discuss
βœ… Correct Answer: (C) bool(true)

Q. What is name of PHP "<=>" operator?

  • (A) Spaceship
  • (B) Safe Spaceship
  • (C) Identity
  • (D) Identical
πŸ’¬ Discuss
βœ… Correct Answer: (A) Spaceship

Q. Which PHP operator known as "Null coalescing" operator?

  • (A) ?
  • (B) ?=>
  • (C) ??
  • (D) ???
πŸ’¬ Discuss
βœ… Correct Answer: (C) ??

Q. What will be the output of the following PHP code?

Code:
<?php
$x = 100;

if ($x < 200){
    echo "True";
}
else{
    echo "False";
}
?>
  • (A) True
  • (B) False
  • (C) Either A or B
  • (D) None of these
πŸ’¬ Discuss
βœ… Correct Answer: (A) True

Q. What will be the output of the following PHP code?

Code:
<?php
$a = 15;
$b = 20;

if ($a < ++$a || $b < ++$b){
    echo "True";
}
else{
    echo "False";
}
?>
  • (A) True
  • (B) False
  • (C) TrueFalse
  • (D) Parse Error
πŸ’¬ Discuss
βœ… Correct Answer: (B) False

Q. Which PHP statement is used to select one of many blocks of code to be executed?

  • (A) The if statement
  • (B) The if...else statement
  • (C) The switch statement
  • (D) The select statement
πŸ’¬ Discuss
βœ… Correct Answer: (C) The switch statement