Use child method from parent class
<p><strong>classes.php</strong></p>

<pre><code>class System {

    protected $domain;

    public function __construct($domain) {
        $this-&gt;domain = $domain;
    }

}

class Subsystem extends System {

    public function __construct() {
        parent::__construct();
    }

    public function getDomain() {
        echo $this-&gt;domain;
    }

 }
</code></pre>

<p><strong>index.php</strong>


<pre><code>require('classes.php');

$system = new System('http://google.com');
$system-&gt;getDomain();
</code></pre>

<p>I recently decided to move from procedural to object-oriented PHP, but I'm having an issue understanding the concepts of inheritance.
Why doesn't the above code work? The page returns this error: <strong>Fatal error: Uncaught Error: Call to undefined method System::getDomain()</strong></p>