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

Code:
<?php
$p = 8; $r = 7; $q = 15; 
$s = $p + $r == $q;
print $s;
?>
  • (A) 15
  • (B) 1
  • (C) 8
  • (D) 7
πŸ’¬ Discuss
βœ… Correct Answer: (A) 15

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

Code:
<?php
$m = 10; $n = -8; $t = 2; 
$k = ++$m && ++$n || ++$t;
echo $k; 
echo $m;
?>
  • (A) 10
  • (B) -8
  • (C) 111
  • (D) 2
πŸ’¬ Discuss
βœ… Correct Answer: (C) 111

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

Code:
<?php
$p = 10;
$r = $p++; $q = ++$p;
print $p; 
print $q; 
?>
  • (A) Error
  • (B) 12
  • (C) Nothing
  • (D) 1212
πŸ’¬ Discuss
βœ… Correct Answer: (D) 1212

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

Code:
<?php
$p = 20; $q = 20;
if ($p = 12)
    $q--;
echo $p;
echo $q--;
?>
  • (A) 12
  • (B) Error
  • (C) Nothing
  • (D) 1219
πŸ’¬ Discuss
βœ… Correct Answer: (D) 1219

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

Code:
<?php
$p = 2; $q = 2; $r = 2;
echo ++$p + ++$p+$p++; print $p++ + ++$q; print ++$r + $r++ + $p++;
?>
  • (A) Nothing
  • (B) 11812
  • (C) 12811
  • (D) Error
πŸ’¬ Discuss
βœ… Correct Answer: (B) 11812

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

Code:
<?php
$p = 3; 
$q = 4;
$r = $p++ + ++$q;
echo $r;
?>
  • (A) Error
  • (B) 8
  • (C) 3
  • (D) 4
πŸ’¬ Discuss
βœ… Correct Answer: (B) 8

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

Code:
<?php
$p = 20;
$q = 10;
if ($p || ($q = $p + 10)) {
    echo "True";
}
echo $q;
?>
  • (A) 10
  • (B) 20
  • (C) 10True
  • (D) True10
πŸ’¬ Discuss
βœ… Correct Answer: (D) True10

Q. PHP stands for

  • (A) Hypertext Preprocessor
  • (B) Pretext Hypertext Preprocessor
  • (C) Personal Home Processor
  • (D) None of the above
πŸ’¬ Discuss
βœ… Correct Answer: (A) Hypertext Preprocessor

Q. Who is known as the father of PHP?

  • (A) List Barely
  • (B) Drek Kolkevi
  • (C) Rasmus Lerdrof
  • (D) None of the above
πŸ’¬ Discuss
βœ… Correct Answer: (C) Rasmus Lerdrof

Q. Variable name in PHP starts with

  • (A) ! (Exclamation)
  • (B) $ (Dollar)
  • (C) & (Ampersand)
  • (D) # (Hash)
πŸ’¬ Discuss
βœ… Correct Answer: (B) $ (Dollar)