1. Question: How can you modify the copy of an object during a clone operation?

    A
    Put the logic in the object's constructor to alter the values

    B
    Implment your own function to do object copying

    C
    Implement the object's __clone() method

    D
    Implement __get() and __set() methods with the correct logic

    E
    Implement the __copy() method with the correct logic

    Note: Not available
    1. Report
  2. Question: What is the primary difference between a method declared as static and a normal method?

    A
    Static methods can only be called using the :: syntax and never from an instance

    B
    Static methods do not provide a reference to $this

    C
    Static methods cannot be called from within class instances

    D
    Static methods don't have access to the self keyword

    E
    There is no functional difference between a static and non-static method

    Note: Not available
    1. Report
  3. Question: What is the output of the following script?
    <?php
    
    class ClassOne {
      protected $a = 10;
    
      public function changeValue($b) {
        $this->a = $b;
      }
    }
    
    class ClassTwo extends ClassOne {
    
      protected $b = 10;
    
      public function changeValue($b) {
        $this->b = 10;
        parent::changeValue($this->a + $this->b);
      }
    
      public function displayValues() {
        print "a: {$this->a}, b: {$this->b}\n";
      }
    }
    
    $obj = new ClassTwo();
    
    $obj->changeValue(20);
    $obj->changeValue(10);
    
    $obj->displayValues();
    
    ?>

    A
    a: 30, b: 30

    B
    a: 30, b: 20

    C
    a: 30, b: 10

    D
    a: 20, b: 20

    E
    a: 10, b: 10

    Note: Not available
    1. Report
  4. Question: The ______ keyword is used to indicate an incomplete class or method, which must be further extended and/or implemented in order to be used.

    A
    final

    B
    protected

    C
    incomplete

    D
    abstract

    E
    implements

    Note: Not available
    1. Report
  5. Question: To ensure that a given object has a particular set of methods, you must provide a method list in the form of an ________ and then attach it as part of your class using the ________ keyword.

    A
    array, interface

    B
    interface, implements

    C
    interface, extends

    D
    instance, implements

    E
    access-list, instance

    Note: Not available
    1. Report
  6. Question: Type-hinting and the instanceof keyword can be used to check what types of things about variables?

    A
    If a particular child class extends from it

    B
    If they are an instance of a particular interface

    C
    If they are an abstract class

    D
    If they have a particular parent class

    E
    If they are an instance of a particular class

    Note: Not available
    1. Report
  7. Question: In PHP 5's object model, a class can have multiple ______ but only a single direct ________.

    A
    None

    B
    interfaces, child

    C
    children, interface

    D
    interfaces, parent

    E
    parents, interface

    Note: Not available
    1. Report
  8. Question: What three special methods can be used to perform special logic in the event a particular accessed method or member variable is not found?

    A
    __get($variable)

    B
    __call($method, $params)

    C
    __get($method)

    D
    __set($variable, $value)

    E
    __call($method)

    Note: Not available
    1. Report
  9. Question: The _______ method will be called automatically when an object is represented as a string.

    A
    getString()

    B
    __get()

    C
    __value()

    D
    __toString()

    E
    __getString()

    Note: Not available
    1. Report
  10. Question: When an object is serialized, which method will be called, automatically, providing your object with an opportunity to close any resources or otherwise prepare to be serialized?

    A
    __destroy()

    B
    __serialize()

    C
    __destruct()

    D
    __shutdown()

    E
    __sleep()

    Note: Not available
    1. Report
Copyright © 2024. Powered by Intellect Software Ltd