In this example I get the fatal error "Fatal error: Using $this when not in object context" as expected
class ctis_parent{
public function objFunc(){
var_dump('Called succes');
}
public static function call(){
$this->objFunc();
}
public function __construct(){
self::call();
}
}
new ctis_parent();
But if remove static keyword from definition of call() method all work fine, why?
class ctis_parent{
public function objFunc(){
var_dump('Called succes');
}
public function call(){
$this->objFunc();
}
public function __construct(){
self::call();
}
}
new ctis_parent();
//string 'Called succes' (length=13)