3v4l.org

run code in 300+ PHP versions simultaneously
<?php class StaticA { public function setEmail($redirect) { $this->email = $redirect; } protected function returnthis(){ return $this; } private function dosomething(){ echo "Unrsprüngliche Methode"; $obj = parent::returnthis(); echo $obj->email; } public function classInfo(){ echo get_class(new static). "\n"; echo $this->email. "\n"; } } class StaticB extends StaticA { public function test(){ //echo get_class(new self). "\n"; parent::classInfo(); } public function doit(){ $this->dosomething(); //echo $this->email. "\n"; } private function dosomething(){ $obj = parent::returnthis(); echo "Neue Methode!"; echo $obj->email; } } $object = new StaticB(); $object->setEmail("erno@01art.de"); $object->doit();

This is an error 404

There are `0` results


preferences:
157.65 ms | 1398 KiB | 7 Q