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 is the data type of $TV in the above code?

<php

$TV;
echo gettype($TV);

?>

Integer
String
Unknown
Null

2. Regenerating the session ID after authentication methods can prevent session fixation attacks in PHP.

TRUE
FALSE
Can be true or false
None of the above

3. Operator ? Means?

Assignment Operators
Modulus AND assignment operator
Conditional Operator
Divide AND assignment operator

4. Predict the output of the following code snippet :

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

11,11,11
10,11,11
10,11,10
10,10,10

5. What is the output of the following php code?

<?php
 $alphabet = array ("A", "B", "C");
 echo (next($alphabet));
 ?>

A
B
C
Error

6. The purpose of r+ mode is?

Opens the file for reading and writing
Places the file pointer at the beginning of the file
Places the file pointer at the end of the file
Both A and B

7. Constants, like variables, can hold _________.

integer
string
Both A and B
None of the above

8. A variable declared _____ has a GLOBAL SCOPE?

outside program
inside function
outside function
None Of the Above

9. Which of the below statements are false?

Exception class can be inherited
The methods in Exception class are defined as abstract
The methods in Exception class are defined as final
Sub classess of Exception, can define new methods to extend the functionality

10. 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)

Results