My Report

PHP Programming Practice 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

1. 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);
?>

2. Which feature allows us to call more than one method or function of the class in single instruction?

3. Which one of the following is the right way to clone an object?

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

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

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

6. Which of the following term originates from the Greek language that means "having multiple forms," defines OOP's ability to redefine, a class's characteristics?

7. Which method scope prevents a method from being overridden by a subclass?

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

<?php
$number = range(0, 5);
print_r ($number);
?>

9. Which function initializes the constants necessary for using the openlog(), clodelog(), and syslog() functions?

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

    <?php
    $face = array ("A", "J", "Q", "K");
    $number = array ("2","3","4", "5", "6", "7", "8", "9", "10");
    $cards = array_merge ($face, $number);
    print_r ($cards);
    ?> 

 

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.