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. choose the incorrect variable name in php?

$_AGE
$18AGE
$AGE18
$_AGE18

2. Close the file with fclose() function.

Yes
No
Can be yes or no
Can not say

3. What is the advantage of log_errors directive?

Helps in trouble shooting of the application
Displays error messages on the browser
Displays only errors which meet the criteria
None of the above

4. Which of the following is the default name of the session cookie in PHP?

PHP_SESSION
session_id
PHPSESSID
session_cookie

5. How many main parameter are used in for loop?

2
3
4
1

6. Which one of the following is the right way to call a class constant, given that the class is mathFunction?

echo mathFunction->PI;
echo PI;
echo mathFunction::PI;
echo mathFunction=PI;

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

<?php
$i=-5;
while($i){
        $i++;
        if($i%2==0)
                continue;
        else
        {
                $i++;
        }
       echo($i);
}
?>

4 to 20
-20
Null
infinite loop

8. Which of the following function is Used to set the array pointer to the value of last key?

last()
end()
next()
final()

9. Function names are case-sensitive.

True
False
Only Built-In function
Only User-defined function

10. Which of the following will be output of the following code?

<?php
function myTest() {
    static $x;
    echo $x;
}

myTest();

?> 

0
1
No Output
Error

Results