PHP Programming Quiz


Play this quiz that will help you to excel in PHP certification exams, placements etc. This PHP programming quiz consist of 10 questions that you need to solve in 10 minutes. We’ve specially designed this quiz so that you can quickly acquaint to the pattern of questions you can be asked in placement drives, certification exams etc. This PHP programming test enables you to assess your knowledge of PHP programming.

Take the Free Practice Test



PHP MCQs

Practice PHP MCQ Questions, which will help you to clear your PHP Programming related concepts and also helps you to prepare for placements, technical rounds, interviews, competitive exams etc.

PHP Quiz

Try Free PHP Quiz, to start a quiz you need to login first, after login you will get start quiz button and then by clicking on that you can start quiz. You will get 10 Minutes to answer all questions.

PHP Quiz

1. Which is the correct method to turn off error display?

ini_set("Off")
init_set("error_reporting","Off")
error_reporting=Off
init_set("error_reporting=Off")

2. Classes are the _______ of objects.

type
blueprints
reference
instances

3. The PHP syntax is most similar to:

VBScript
JavaScript
Perl and C
All of the above

4. A variable declared _____ has a GLOBAL SCOPE?

outside program
inside function
outside function
None Of the Above

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

<?php 
    $title = "O malley wins the heavyweight championship!";
    echo ucwords($title);
?>

O Malley Wins The Heavyweight Championship!
O malley Wins The Heavyweight Championship!
O Malley wins the heavyweight championship!
o malley wins the heavyweight championship!

6. In which year php was created?

1993
1994
1995
1996

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

<?php
$a = 1;
$b = 2;
$c = 3;
echo ($a % ($b) + $c);
?>

2
3
4
5

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

<?php
$x = 1;
$y = 2;
$z = "$x + $y";
echo "$z";
?<

$x + $y
3
1+2
12

9. foreach loop is used to iterate over ____?

number
object
function
array

10. A function in PHP which starts with double underscore is known as __________.

Magic Function
Inbuilt Function
Default Function
User Defined Function

Results