My Report

PHP Programming Mock Test 2


Correct Answer: 2 points | Wrong: -1 point
Grades: A* (100% score) | A (80%-99%) | B (60%-80%) | C (40%-60%) | D (0%-40%)
advertisement
 10%

Question 1 of 10

1. Which of the following statements causes PHP to disregard repeated error messages that occur within the same file and on the same line?

Question 1 of 10

Question 2 of 10

2. The practice of creating objects based on predefined classes is often referred to as ______________

Question 2 of 10

Question 3 of 10

3. Which character does the error_reporting directive use to represent the logical operator NOT?

Question 3 of 10

Question 4 of 10

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

<?php
$a = array("a" => "Jaguar", "b" => "Land Rover", 
"c" => "Audi", "d" => "Maseratti");
echo array_search("Audi", $a);
?>

Question 4 of 10

Question 5 of 10

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

	
    <?php
    $fruits = array ("mango", "apple", "pear", "peach");
    $fruits = array_flip($fruits);
    echo ($fruits[0]);
    ?>

Question 5 of 10

Question 6 of 10

6. Which function should we use to sort the array in natural order?

Question 6 of 10

Question 7 of 10

7. Which of the following advanced OOP features is/are not supported by PHP?

i) Method overloading
ii) Multiple Inheritance
iii) Namespaces
iv) Object Cloning

Question 7 of 10

Question 8 of 10

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

<?php
$a1 = array("a"=>"red", "b"=>"green", "c"=>"blue", "d"=>"yellow");
$a2 = array("e"=>"red", "f"=>"green", "g"=>"blue");
$result = array_diff($a1, $a2);
print_r($result);
?>

Question 8 of 10

Question 9 of 10

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

<?php
$a = array(12, 5, 2);
echo(array_product($a));
?>

Question 9 of 10

Question 10 of 10

10. Which version of PHP introduced the advanced concepts of OOP?

Question 10 of 10


 

Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.