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 of the following is the output of the below code?

<?php
   class lfc { 
  
      var $mcq_type; 
     
      function setmcq_type($par){ 
         $this->mcq_type = $par; 
      } 
        
      function getmcq_type(){ 
         echo $this->mcq_type."<br>"; 
      } 
        
   } 
  
  
   $obj = new lfc; 
  
 
   $obj->setmcq_type("Objects Mcq"); 
   $obj->getmcq_type(); 
?> 

Objects Mcq
Objects Mcq ""
Error
No Output

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

<?php
print("I"."am"."learning"."php");
?>

Iamlearningphp
I am learning php
Nothing
error

3. The spliti() function operates exactly in the same manner as its sibling split(), except that it is not case sensitive.

TRUE
FALSE
Can be true or false
Can not say

4. The PHP syntax is most similar to:

VBScript
JavaScript
Perl and C
All of the above

5. How many types of array are available in php?

1
2
3
4

6. What is the description of Error level E_ERROR?

Fatal run-time error
Near-fatal error
Compile-time error
Fatal Compile-time error

7. What is the use of is_array() function?

Function is used to print the array in readable format.
Adds elements to the beginning of the array and returns the size of array.
Function can be used to verify if a variable is an array. Returns TRUE or FALSE
Adds elements to the end of the array and returns the size of array.

8. The files length can be found using the _______function.

fsize()
fcount()
filesize()
count()

9. How to destroy the session?

session_reset()
session_destroy()
session_end()
session_kill()

10. Which loop evaluates the condition expression as Boolean, if it is true, it executes the statements and when it is false it will terminate?

For loop
while loop
do-while loop
All of the above

Results