- Output for 5.3.0 - 5.3.28, 5.4.0 - 5.4.27
- Fatal error: Cannot make static method StaticA::dosomething() non static in class StaticB in /in/jBZbr on line 41
Process exited with code 255.
<?php
class StaticA {
public function setEmail($redirect) {
$this->email = $redirect;
}
static function dosomething(){
$obj = new static;
$obj->email = "e@01art.de";
$obj->classInfo();
}
function classInfo(){
echo get_class(new static). "\n";
echo $this->email. "\n";
}
}
class StaticB extends StaticA {
function test(){
//echo get_class(new self). "\n";
parent::classInfo();
}
function doit(){
self::dosomething();
echo $this->email. "\n";
}
function dosomething(){
echo "this is overwritten now". $this->email. "\n";
}
}
$object = new StaticB();
$object->setEmail("erno@01art.de");
$object->doit();