PHP MCQ - English


Basic MCQ Questions and Answers

Home | PHP | Basic

PHP MCQ Questions and Answers: Here learn quiz questions on Basic PHP and download pdf 50 most important objective questions with answers.

Page: 1/3

1) PHP files have a default file extension of..

2) A PHP script should start with ___ and end with ___:

3) Which of the following is/are a PHP code editor?

4) Which version of PHP introduced Try/catch Exception?

Free Online Test

5) We can use _________ to comment a single line?

  1. /?
  2. //
  3. #
  4. /* */

6) Which of the following php statement/statements will store 111 in variable num?

  1. int $num = 111;
  2. int mum = 111;
  3. $num = 111;
  4. 111 = $num;

7) What will be the output of the following php code?

 $num  = 1;
$num1 = 2;
print $num . "+". $num1;
?>

8) What will be the output of the following php code?

 $num  = "1";
$num1 = "2";
print $num+$num1;
?>

9) Which of following variables can be assigned a value to it?

  1. $3hello
  2. $_hello
  3. $this
  4. $This

10) What will be the output of the following code?

  $foo = 'Bob';
$bar = &$foo;
$bar = "My name is $bar";
echo $bar;
echo $foo;
?>

Free Online Test