3v4l.org

run code in 300+ PHP versions simultaneously
<?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"; } static function dosomething(){ echo "this is overwritten now". $this->email. "\n"; } } $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)
8.3.60.0090.00918.53
8.3.50.0190.01222.12
8.3.40.0110.00418.96
8.3.30.0070.00719.08
8.3.20.0040.00420.29
8.3.10.0040.00422.10
8.3.00.0040.00422.45
8.2.180.0090.00616.85
8.2.170.0040.01122.96
8.2.160.0110.00420.47
8.2.150.0040.00424.18
8.2.140.0090.00024.66
8.2.130.0040.00426.16
8.2.120.0040.00417.75
8.2.110.0040.00422.21
8.2.100.0060.00619.30
8.2.90.0000.00818.91
8.2.80.0040.00717.97
8.2.70.0030.00617.50
8.2.60.0050.00317.93
8.2.50.0040.00418.07
8.2.40.0080.00018.03
8.2.30.0030.00518.14
8.2.20.0000.00817.73
8.2.10.0000.00819.45
8.2.00.0030.00517.70
8.1.280.0140.00025.92
8.1.270.0050.00322.04
8.1.260.0080.00026.35
8.1.250.0070.00028.09
8.1.240.0030.00623.95
8.1.230.0120.00019.04
8.1.220.0040.00417.74
8.1.210.0000.00818.77
8.1.200.0030.00617.35
8.1.190.0050.00317.53
8.1.180.0060.00318.10
8.1.170.0040.00418.51
8.1.160.0040.00422.03
8.1.150.0030.00518.59
8.1.140.0030.00517.37
8.1.130.0040.00417.72
8.1.120.0050.00317.31
8.1.110.0000.00717.36
8.1.100.0000.00717.38
8.1.90.0000.00817.43
8.1.80.0040.00417.39
8.1.70.0000.00717.43
8.1.60.0050.00317.50
8.1.50.0000.00817.55
8.1.40.0000.00717.56
8.1.30.0030.00517.63
8.1.20.0000.00817.57
8.1.10.0080.00017.55
8.1.00.0020.00517.46
8.0.300.0040.00418.77
8.0.290.0040.00416.93
8.0.280.0000.00718.33
8.0.270.0000.00717.22
8.0.260.0030.00316.86
8.0.250.0000.00617.02
8.0.240.0060.00317.00
8.0.230.0070.00016.99
8.0.220.0040.00416.80
8.0.210.0000.00716.90
8.0.200.0000.00617.01
8.0.190.0040.00416.86
8.0.180.0000.00716.95
8.0.170.0000.00816.90
8.0.160.0040.00416.78
8.0.150.0040.00416.84
8.0.140.0040.00416.85
8.0.130.0050.00013.30
8.0.120.0040.00416.91
8.0.110.0070.00016.78
8.0.100.0000.00817.02
8.0.90.0040.00416.86
8.0.80.0070.00816.89
8.0.70.0040.00416.86
8.0.60.0020.00516.86
8.0.50.0040.00416.73
8.0.30.0120.00717.22
8.0.20.0100.00917.40
8.0.10.0000.00716.88
8.0.00.0110.00816.94
7.4.330.0030.00315.00
7.4.320.0030.00316.32
7.4.300.0000.00616.63
7.4.290.0000.00716.57
7.4.280.0000.00816.57
7.4.270.0030.00316.43
7.4.260.0040.00416.37
7.4.250.0000.00716.39
7.4.240.0020.00516.54
7.4.230.0050.00316.32
7.4.220.0060.01316.47
7.4.210.0100.00416.51
7.4.200.0030.00316.69
7.4.190.0040.00416.73
7.4.160.0100.00716.67
7.4.150.0120.00717.40
7.4.140.0130.00817.86
7.4.130.0100.01016.74
7.4.120.0060.01216.46
7.4.110.0130.00716.54
7.4.100.0030.01316.53
7.4.90.0090.00916.43
7.4.80.0100.01019.39
7.4.70.0100.00716.57
7.4.60.0040.01416.65
7.4.50.0050.00316.35
7.4.40.0090.00922.77
7.4.30.0120.00416.50
7.4.00.0060.01014.81
7.3.330.0020.00313.19
7.3.320.0030.00313.21
7.3.310.0030.00616.41
7.3.300.0000.00716.26
7.3.290.0060.00916.36
7.3.280.0080.00816.37
7.3.270.0150.00917.40
7.3.260.0030.01316.56
7.3.250.0110.00816.45
7.3.240.0060.01116.39
7.3.230.0120.00916.39
7.3.210.0070.01016.51
7.3.200.0090.01319.39
7.3.190.0110.00916.32
7.3.180.0070.00716.46
7.3.170.0110.00716.50
7.3.160.0100.00616.42
7.3.120.0130.00314.89
7.2.330.0120.00916.46
7.2.320.0040.01916.75
7.2.310.0100.01316.72
7.2.300.0130.00316.53
7.2.290.0070.01316.52
7.2.60.0140.00016.96
7.2.00.0030.01019.13
7.1.200.0000.00715.65
7.1.100.0040.01117.89
7.1.70.0070.00716.86
7.1.60.0170.00719.82
7.1.50.0030.01716.89
7.1.00.0030.07322.45
7.0.200.0000.00816.77
7.0.140.0000.07322.07
7.0.60.0100.08019.91
7.0.50.0070.08017.88
7.0.40.0070.08320.22
7.0.30.0400.07020.15
7.0.20.0270.07320.08
7.0.10.0230.05320.21
7.0.00.0070.07020.33
5.6.280.0030.07321.02
5.6.210.0100.08320.67
5.6.200.0030.04718.16
5.6.190.0100.08020.55
5.6.180.3400.03720.67
5.6.170.0270.07320.47
5.6.160.0100.07720.54
5.6.150.0100.07718.13
5.6.140.0070.06718.28
5.6.130.0030.09018.27
5.6.120.0100.04721.15
5.6.110.0000.05721.12
5.6.100.0100.07721.04
5.6.90.0170.07321.11
5.6.80.0130.07020.53
5.6.70.0270.06320.36
5.5.350.0030.08320.43
5.5.340.0030.05017.98
5.5.330.0100.06720.27
5.5.320.0270.04320.30
5.5.310.0370.06320.36
5.5.300.0070.08318.08
5.5.290.0030.07717.99
5.5.280.0130.07320.74
5.5.270.0070.04320.88
5.5.260.0030.04320.80
5.5.250.0030.04020.60
5.5.240.0000.06020.29
5.4.450.0130.02319.55
5.4.440.0470.04319.48
5.4.430.0300.05719.58
5.4.420.0300.06019.54
5.4.410.0070.06319.02
5.4.400.0070.06318.74
5.4.390.0130.05318.84
5.4.380.0230.05318.61
5.4.370.0230.04718.60
5.4.360.0230.05318.72
5.4.350.0270.05018.78
5.4.340.0130.05718.75
5.4.320.0050.03712.50
5.4.310.0060.04012.50
5.4.300.0050.04212.50
5.4.290.0050.04412.50
5.4.280.0060.03412.40
5.4.270.0230.04719.14
5.4.260.0070.06018.91
5.4.250.0070.06719.02
5.4.240.0200.05719.13
5.4.230.0200.06318.94
5.4.220.0170.06318.85
5.4.210.0170.06018.91
5.4.200.0170.05019.00
5.4.190.0130.05019.00
5.4.180.0100.05718.93
5.4.170.0100.06319.01
5.4.160.0200.04719.00
5.4.150.0100.05718.99
5.4.140.0170.05016.74
5.4.130.0100.06316.45
5.4.120.0070.05316.45
5.4.110.0070.05316.63
5.4.100.0170.05016.77
5.4.90.0170.05716.54
5.4.80.0100.05316.62
5.4.70.0030.06016.61
5.4.60.0130.07316.66
5.4.50.0100.05716.65
5.4.40.0130.05716.67
5.4.30.0100.05016.68
5.4.20.0170.04716.67
5.4.10.0100.06716.64
5.4.00.0130.06716.06
5.3.290.0060.03812.80
5.3.280.0070.07714.48
5.3.270.0070.05714.74
5.3.260.0170.04714.80
5.3.250.0100.05314.66
5.3.240.0070.05314.89
5.3.230.0070.05014.49
5.3.220.0130.06014.64
5.3.210.0100.05314.45
5.3.200.0070.06014.84
5.3.190.0400.04014.84
5.3.180.0170.07314.63
5.3.170.0070.06714.83
5.3.160.0100.06014.88
5.3.150.0000.06014.84
5.3.140.0130.05014.79
5.3.130.0070.05714.84
5.3.120.0170.06014.83
5.3.110.0170.05314.84
5.3.100.0130.06713.95
5.3.90.0170.07014.20
5.3.80.0270.05014.22
5.3.70.0130.05314.21
5.3.60.0000.05714.21
5.3.50.0130.06014.00
5.3.40.0200.05014.02
5.3.30.0170.04714.20
5.3.20.0170.04713.92
5.3.10.0000.05713.96
5.3.00.0070.07313.77
5.2.170.0070.05311.45
5.2.160.0030.06711.14
5.2.150.0070.05311.20
5.2.140.0100.05011.02
5.2.130.0070.05311.30
5.2.120.0000.06011.40
5.2.110.0100.05011.11
5.2.100.0070.04711.31
5.2.90.0030.05011.15
5.2.80.0100.04711.29
5.2.70.0100.04711.27
5.2.60.0030.04710.94
5.2.50.0030.04710.90
5.2.40.0170.03311.27
5.2.30.0130.04311.14
5.2.20.0000.05011.01
5.2.10.0030.04711.04
5.2.00.0100.03710.90
5.1.60.0100.04010.09
5.1.50.0030.0509.99
5.1.40.0070.04310.27
5.1.30.0130.03310.21
5.1.20.0130.04710.62
5.1.10.0100.04710.28
5.1.00.0070.0509.95
5.0.50.0070.0338.88
5.0.40.0170.0238.68
5.0.30.0030.0578.52
5.0.20.0070.0338.41
5.0.10.0030.0408.23
5.0.00.0070.0538.16
4.4.90.0130.0135.96
4.4.80.0070.0205.93
4.4.70.0030.0235.92
4.4.60.0070.0275.97
4.4.50.0030.0205.92
4.4.40.0030.0335.88
4.4.30.0030.0275.96
4.4.20.0000.0275.96
4.4.10.0000.0276.01
4.4.00.0130.0336.12
4.3.110.0030.0235.89
4.3.100.0000.0235.86
4.3.90.0030.0305.86
4.3.80.0000.0375.77
4.3.70.0000.0305.89
4.3.60.0000.0275.76
4.3.50.0070.0205.86
4.3.40.0070.0335.84
4.3.30.0030.0235.65
4.3.20.0070.0205.65
4.3.10.0070.0235.65
4.3.00.0030.0204.43

preferences:
41.36 ms | 401 KiB | 5 Q