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 
  
var_dump(strpos("Hello letsfindcourse!", "course")); 
    
?>

int(13)
char(14)
int(14)
int(15)

2. Predict the output of the following code snippet :

<?php
$i=10;
function sample($i)
{
    $i+=2;
    GLOBAL $i;
    echo $i+$i,",";
}
echo $i.",";
GLOBAL $i;
sample($i);
echo $i;
?>

10,20,10
10,24,10
10,20,20
10,22,10

3. What is the use of array_unshift() 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.

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

Magic Function
Inbuilt Function
Default Function
User Defined Function

5. choose the incorrect variable name in php?

$_AGE
$18AGE
$AGE18
$_AGE18

6. 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")

7. How many functions does PHP offer for searching and modifying strings using Perl-compatible regular expressions.

7
8
9
10

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

<?php
$a = 10;
$b = $a>2?"Hi":"Bye";
echo "$b";
?>

HiBye
Bye
Hi
Error

9. How many error levels are available in PHP?

14
15
16
17

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

<?php
echo "This","is"&"a","PHP"."MCQs";
?>

ThisisaPHPMCQs
Thisis PHPMCQs
This aPHPMCQS
ThisaPHPMCQs

Results