<?php abstract class SuperAbstract { static function create() { return new static(); } } class Extended extends SuperAbstract { private $hello = ''; protected function __construct() { $this->hello = "world"; } public function hello() { return "hello " . $this->hello; } } // works $a = Extended::create(); echo $a->hello(); echo "\n\nNow we'll fail, trying to call 'new' directly:\n"; // can't touch this $b = new Extended();
You have javascript disabled. You will not be able to edit any code.
There are `>1` results