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!". "\n"; echo "Hier ist die E-Mail aus der Elternklasse: "$obj->email; } } $object = new StaticB(); $object->setEmail("erno@01art.de"); $object->doit();

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
5.4.270.1800.03719.09
5.4.260.1970.03718.96
5.4.250.1900.03719.20
5.4.240.2130.04719.15
5.4.230.0430.04018.98
5.4.220.0230.04719.21
5.4.210.0300.05319.08
5.4.200.0200.05319.23
5.4.190.0200.06018.83
5.4.180.0230.07318.86
5.4.170.0200.06319.18
5.4.160.0130.05019.05
5.4.150.0230.06719.05
5.4.140.0200.07016.43
5.4.130.0170.07016.40
5.4.120.0270.03716.46
5.4.110.0200.07716.56
5.4.100.0230.04716.50
5.4.90.0170.03316.41
5.4.80.0230.04316.31
5.4.70.0170.03316.39
5.4.60.0200.05316.56
5.4.50.0100.04016.32
5.4.40.0170.03316.55
5.4.30.0200.05016.37
5.4.20.0200.03716.55
5.4.10.0170.03716.33
5.4.00.0130.03715.82
5.3.280.0200.07714.52
5.3.270.0230.06714.53
5.3.260.0230.03314.63
5.3.250.0170.07314.85
5.3.240.0200.04014.78
5.3.230.0230.04714.70
5.3.220.0230.05014.50
5.3.210.0230.05314.67
5.3.200.0270.06714.55
5.3.190.0230.04014.60
5.3.180.0230.03314.66
5.3.170.0270.05014.82
5.3.160.0170.07014.48
5.3.150.0230.07314.73
5.3.140.0200.04714.58
5.3.130.0300.05714.79
5.3.120.0000.06714.79
5.3.110.0200.03714.61
5.3.100.0200.07314.10
5.3.90.0130.04714.04
5.3.80.0230.07014.04
5.3.70.0230.06014.11
5.3.60.0130.04014.11
5.3.50.0200.07713.86
5.3.40.0270.03313.88
5.3.30.0270.06014.04
5.3.20.0230.03313.75
5.3.10.0170.05313.73
5.3.00.0230.06313.58

preferences:
138.74 ms | 1394 KiB | 7 Q