Inheritance

class ExtendClass extends SimpleClass
{
    // Redefine the parent method
    function displayVar()
 {
        echo "Extending class\n";
        parent::displayVar();
    }
}
$extended = new ExtendClass();
$extended->displayVar();
Comments