i aşağıdaki sınıfları var.
class base {
private function __construct(){
//check if foo method exists
//$this->foo(); // if it exists
}
public static function singleton(){
if(!isset(self::$singleton)){
self::$singleton = new base();
}
return self::$singleton;
}
}
class sub extends base{
public function __construct() {
parent::singleton();
}
public function foo(){
}
}
o yüzden gibi init
$test = new sub();
my problem is that I want to check on base __construct
if the sub has a foo
method.
but it doesn't seem to have this method.
Birisi nerede yanlış gitmiş bana söyleyebilir?