Start PHP Code RESULT
Hello, my name is harry
Hello, my name is Son of Harry
End PHP Code RESULT
The PHP Code START
class first_class{
    var $name = "Harry";
     
    function first_class( $n="harry") {
        $this->name= $n;
    }
    
    function sayHello() {
        print "Hello, my name is $this->name<br />";
    }
}

class second_class extends first_class {

}

$test1 = new first_class();
$test1->sayHello();
$test2 = new second_class("Son of Harry");
$test2->sayHello();
// Outputs "Hello, my name is Son of Harry"
The PHP Code END