Q.1
Which of the following is/are the right way to declare a method?
1. function functionName() { function body }
2. scope function functionName() { function body }
3. method methodName() { method body }
4. scope method methodName() { method body }
Q.2
Which one of the following statements is true ?
class CopyMe {}
$first = new CopyMe();
$second = $first;
Q.3
Which keyword must be added before $first variable on the third line of the above question to make $second and $first as distinct objects in PHP 5?
Q.4
What will be the output of the following PHP code
class Person 
{
    function getName() { return "Bob"; }
    function getAge() { return 44; }
    function __toString() {
        $desc = $this->getName();
        $desc .= " (age ".$this->getAge().")";
        return $desc;
    }
}
$person = new Person();
print $person;
Q.5
______clone() is run on the _______ object.
Q.6
Which method is invoked when an undefined property is accessed ?
Q.7
What will be the output of the following PHP code?
class Checkout
 {
    final function totalize() 
    {
        // calculate bill
    }
 }
 
class IllegalCheckout extends Checkout 
{
    final function totalize() 
    {
        // change bill calculation
    }
}
Q.8
The practice of separating the user from the true inner workings of an application through well-known interfaces is known as _________
Q.9
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?
Q.10
The practice of creating objects based on predefined classes is often referred to as.
Q.11
Which one of the following property scopes is not supported by PHP?
Q.12
Which keyword is used to put a stop on inheritance?
Q.13
PHP provides built-in interceptor methods, which can intercept messages sent to undefined methods and properties. This is also known as _________
Q.14
Atleast how many abstract methods must an abstract class contain?
Q.15
Which one of the following method is invoked when a value is assigned to an undefined property?
Q.16
Which one of the following is not a valid class name?
Q.17
Which one of the following method is invoked when an undefined method is called by client code?
Q.18
Which one of the following keyword is used to implement an interface?
Q.19
Which version of PHP introduced the concept called late static binding?
Q.20
Which one of the following methods in the exception class, is used to get a nested exception object?
Q.21
What will happen if you try to set a value to a constant once it has been declared?
Q.22
How many of the following can be contained in constants? 1. boolean 2. integer 3. float 4. string
Q.23
Which method introduced in PHP 5, is invoked just before an object is garbage collected?
Q.24
Which one of the following variable cannot be used inside a static method?
Q.25
What does PDO stand for?
Q.26
Which one of the following keyword is used in conjunction with an Exception object?
Q.27
Which one of the following class can not be instantiated?
Q.28
Which one of the following keywords is used to define an abstract class?
Q.29
Which method or property can only be accessed from within the enclosing class? Even subclasses have no access.
Q.30
Which version of PHP allows you to define constant properties within a class?
0 h : 0 m : 1 s