Home
MCQS
PHP MCQ Quiz Hub
PHP Basics Mcq Questions
Choose a topic to test your knowledge and improve your PHP skills
1. What does PHP stand for? i) Personal Home Page ii) Hypertext Preprocessor iii) Pretext Hypertext Processor iv) Preprocessor Home Page
Both (i) and (ii)
Both (ii) and (iv)
Only (ii)
Both (i) and (iii)
2. Who is the father of PHP?
Rasmus Lerdorf
Willam Makepiece
Drek Kolkevi
List Barely
3. PHP files have a default file extension of.
htmlB
xml
.php
.ph
4. A PHP script should start with ___ and end with ___:
< php >
< ? php ?>
< ? ? >
< ?php ? >
5. Which of the following must be installed on your computer so as to run PHP script?
Adobe Dreamweaver
PHP
Apache
IIS
6. Which version of PHP introduced Try/catch Exception?
PHP 4
PHP 5
PHP 5C. PHP 5.3
PHP 6
7. We can use ___ to comment a single line? i) /? ii) // iii) # iv) /* */
Only (ii)B.C. D.
(i), (iii) and (iv)
(ii), (iii) and (iv)
Both (ii) and (iv)
8. Which of the below symbols is a newline character?
/n
/r
9. Which of the following php statement/statements will store 111 in variable num? i) int $num = 111; ii) int mum = 111; iii) $num = 111; iv) 111 = $num;
Both (i) and (ii)
All of the mentioned
Only (iii)
Only (i)
10. What will be the output of the following php code < ?php $num = 1; $num1 = 2; print $num . "+". $num1 ; ?>
3
1+2
1.+.2
Error
11. What will be the output of the following php code? < ?php $num = "1"; $num1 = "2"; print $num+$num1 ;
3
1+2
Error
12
12. Which of following variables can be assigned a value to it? (i) $3hello (ii) $_hello (iii) $this (iv) $This
All of the mentioned
Only (ii)
(ii), (iii) and (iv)
(ii) and (iv)
13. What will be the output of the following code? < ?php $foo = 'Bob'; $bar = &$foo; $bar = "My name is $bar"; echo $bar; echo $foo; ?>
Error
My name is BobBob
My name is BobMy name is Bob
My name is Bob Bob
Submit