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 true about a+ mode?

Opens the file for reading and writing only.
Places the file pointer at the end of the file.
If files does not exist then it attempts to create a file.
All of the above

2. PHP can send and receive cookies?

True
False
PHP older version can not send and receive cookies but new version can.
PHP new version can not send and receive cookies but old version can.

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

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

ThisisaPHPMCQs
ThisisPHPMCQs
Thisis a PHPMCQs
Thisis aPHPMCQS

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

<?php   
$num = 2; 
do { 
    $num += 2; 
    echo $num, "\n"; 
} while ($num < 0); 
?>

Error
No Output
infinite loop
4

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

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

function addNumbers(int $a, int $b) {
    return $a + $b;
}
echo addNumbers(5, "5 days"); 
?>

5+5days
55days
No Output
Error

6. which of the following is correct echo statement?

echo "<h2>PHP is Fun!</h2>";
echo "PHP is Fun!<br>";
echo "PHP ", "is ", "Fun!";
All of the above

7. Regular expressions are nothing more than a sequence or pattern of characters itself.

TRUE
FALSE
Can be true or false
Can not say

8. As compared to associative arrays vector arrays are much

Faster
Slower
Stable
None of the above

9. Which of the following are correct ways of creating an array?
i) arr[0] = "letsfindcourse";
ii) $arr[] = array("letsfindcourse");
iii) $arr[0] = "letsfindcourse";
iv) $arr = array("letsfindcourse");

ii), iii) and iv)
ii) and iii)
Only i)
iii) and iv)

10. Objects are defined as instances of user defined classes that can hold ____________?

values
functions
both values and functions
None of the above

Results