3v4l.org

run code in 300+ PHP versions simultaneously
<?php class StaticA { public function __set() { $this->email = "e@01art.de"; } function dosomething(){ $this->email = "e@01art.de"; $obj = new static; $obj->email = "e@01art.de"; $obj->classInfo(); } function classInfo(){ echo get_class(new static). "\n"; echo $selfemail; } } class StaticB extends StaticA { function test(){ //echo get_class(new self). "\n"; parent::classInfo(); } function doit(){ parent::dosomething(); } } $object = new StaticB(); $object->doit();
Output for 5.3.0 - 5.3.28, 5.4.0 - 5.4.27, 5.5.0 - 5.5.11
Fatal error: Method StaticA::__set() must take exactly 2 arguments in /in/79EbX on line 7
Process exited with code 255.

preferences:
177.2 ms | 1400 KiB | 76 Q