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

Code:
<?php
$m = 10; $n = 11; $s = 12;
print !(( +  + $m + $n) > ($n - $s));
?>
  • (A) 0
  • (B) 1
  • (C) Nothing
  • (D) Error
πŸ’¬ Discuss
βœ… Correct Answer: (C) Nothing

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

Code:
<?php
$m = 10; $n = 11; $s = 12;
print !(($m + $s) < ($n - $s));
?>
  • (A) Error
  • (B) 1
  • (C) Nothing
  • (D) 0
πŸ’¬ Discuss
βœ… Correct Answer: (B) 1

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

Code:
<?php
$n1 = 13;
print ++$n++;
?>
  • (A) Error
  • (B) Nothing
  • (C) 13
  • (D) 14
πŸ’¬ Discuss
βœ… Correct Answer: (A) Error

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

Code:
<?php
$n1 = 5;
print $n = ++$n;
?>
  • (A) 5
  • (B) 3
  • (C) 1
  • (D) 0
πŸ’¬ Discuss
βœ… Correct Answer: (C) 1

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

Code:
<?php
$p = 6; $q = -8; $r = 2; 
$s = ++$p && ++$q || ++$r;
echo $s;
echo $p;
?>
  • (A) 17
  • (B) 6
  • (C) -8
  • (D) 2
πŸ’¬ Discuss
βœ… Correct Answer: (A) 17

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

Code:
<?php
$m = 8;
echo $m = ++$m % 9 + ++$m; 
?>
  • (A) 10
  • (B) 9
  • (C) 8
  • (D) Error
πŸ’¬ Discuss
βœ… Correct Answer: (A) 10

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

Code:
<?php
$n = 15;
$n = $n + 12; 
echo $n++; 
?>
  • (A) 15
  • (B) 12
  • (C) Error
  • (D) 27
πŸ’¬ Discuss
βœ… Correct Answer: (D) 27

Q. PHP is an acronym for ____.

  • (A) Prefix Hypertext Preprocessor
  • (B) Prototype Hypertext Preprocessor
  • (C) Hypertext Preprocessor
  • (D) PHP: Hypertext Preprocessor
πŸ’¬ Discuss
βœ… Correct Answer: (D) PHP: Hypertext Preprocessor

Q. Which is/are statement(s) true about PHP?

  • (A) It is an open-source scripting language
  • (B) PHP scripts execute on the server
  • (C) It is used for developing dynamic & interactive websites
  • (D) All of the above
πŸ’¬ Discuss
βœ… Correct Answer: (D) All of the above

Q. What is the extension of a PHP file?

  • (A) .php
  • (B) .ph
  • (C) .phpfile
  • (D) All of the above
πŸ’¬ Discuss
βœ… Correct Answer: (A) .php