Get your own PHP server Result Size: 625 x 565
x
 
<!DOCTYPE html>
<html>
<body>
<?php
class domain {
  protected static function getWebsiteName() {
    return "W3Schools.com";
  }
}
class domainW3 extends domain {
  public $websiteName;
  public function __construct() {
    $this -> websiteName = parent::getWebsiteName();
  } 
}
$domainW3 = new domainW3;
echo $domainW3 -> websiteName;
?>
 
</body>
</html>
W3Schools.com