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. What will be the output of the following PHP code?

<?php
$arr = array('0' => "Letsfindcourse", 
             '1' => "Computer",  
             '2' => "Science", 
             '3' => "Portal"); 

print_r($arr[-1]); 
?>

Portal
Letsfindcourse
Error
No Output

2. What will be the output of the following code?

<?php declare(strict_types=1); // strict requirement ?>


<?php
function setHeight(int $minheight = 50) {
    echo "The height is : $minheight <br>";
}

setHeight(350);

?>

The height is : 350
The height is : 50
No Output
Error

3. while loop is an _____ control loop ?

exit
exist
easy
entry

4. In PHP, caching is used to ________ page generation time.

maximize
minimize
full
remove

5. Which one of the following PHP function is used to determine a file’s last access time?

fileltime()
filectime()
fileatime()
filetime()

6. Type Hinting was introduced in which version of PHP?

PHP 5.1
PHP 5
PHP 5.3
PHP 5.4

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

<?php
$a = 0;
if($a > 1 );
{
  echo "Sun";   
}
echo "Moon";
?>

SunMoon
Sun
Moon
Error

8. As compared to associative arrays vector arrays are much

Faster
Slower
Stable
None of the above

9. How can errors be logged in files?

Turn on log_errors
Set error_log to file name
Both A and B
None of the above

10. Which one is not a data type in PHP?

Resources
Objects
Null
Void

Results