PHP MCQ Quiz Hub

PHP Basics Mcq Questions

Choose a topic to test your knowledge and improve your PHP skills

What does PHP stand for? i) Personal Home Page ii) Hypertext Preprocessor iii) Pretext Hypertext Processor iv) Preprocessor Home Page





✅ Correct Answer: 1

Who is the father of PHP?





✅ Correct Answer: 1

PHP files have a default file extension of.





✅ Correct Answer: 3

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





✅ Correct Answer: 4

Which of the following must be installed on your computer so as to run PHP script?





✅ Correct Answer: 3

Which version of PHP introduced Try/catch Exception?





✅ Correct Answer: 2

We can use ___ to comment a single line? i) /? ii) // iii) # iv) /* */





✅ Correct Answer: 3

Which of the below symbols is a newline character?





✅ Correct Answer: 2

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;





✅ Correct Answer: 3

What will be the output of the following php code < ?php $num = 1; $num1 = 2; print $num . "+". $num1 ; ?>





✅ Correct Answer: 2

What will be the output of the following php code? < ?php $num = "1"; $num1 = "2"; print $num+$num1 ;





✅ Correct Answer: 1

Which of following variables can be assigned a value to it? (i) $3hello (ii) $_hello (iii) $this (iv) $This





✅ Correct Answer: 4

What will be the output of the following code? < ?php $foo = 'Bob'; $bar = &$foo; $bar = "My name is $bar"; echo $bar; echo $foo; ?>





✅ Correct Answer: 3