3v4l.org

run code in 300+ PHP versions simultaneously
<?php error_reporting(E_ALL); class Base { protected function doSomething() { echo 'here we go' . PHP_EOL; $something = 'aaaaaa'; return $something; } } class Vendor extends Base { protected function doSomething() { // do something.. // call parent (Base::doSomething()) $something = parent::doSomething(); $something .= "bbbbbbbbbbb"; return $something; // do something more } } class Local extends Vendor { protected function doSomething() { // do something.. $grandparent = get_parent_class(get_parent_class($this)); $something = $grandparent::doSomething(); $something .= "cccccccccccc"; return $something; // do something more // do something venture-specific // intention: call grand-parent (Base::doSomething()) parent::doSomething(); // this will call Vendor::doSomething() :( // this would work, without raising a strict error (see https://bugs.php.net/bug.php?id=42016 - not a bug!) Base::doSomething(); // a little more generic, but you need to know about inheritance level: $grandparent = get_parent_class(get_parent_class($this)); $grandparent::doSomething(); // do something more } public function api() { $something = $this->doSomething(); echo $something; } } $local = new Local; $local->api();

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.01216.50
8.3.50.0110.00917.42
8.3.40.0110.00318.70
8.3.30.0080.00818.70
8.3.20.0040.00418.62
8.3.10.0040.00418.83
8.3.00.0060.00317.63
8.2.180.0120.00616.75
8.2.170.0070.00722.96
8.2.160.0110.00421.20
8.2.150.0070.00024.18
8.2.140.0120.00324.66
8.2.130.0030.00626.16
8.2.120.0000.00820.33
8.2.110.0030.00720.88
8.2.100.0120.00017.78
8.2.90.0030.00519.47
8.2.80.0070.00019.29
8.2.70.0000.00817.75
8.2.60.0000.01017.93
8.2.50.0050.00318.07
8.2.40.0080.00018.28
8.2.30.0040.00418.11
8.2.20.0080.00017.84
8.2.10.0040.00417.68
8.2.00.0040.00417.75
8.1.280.0090.00625.92
8.1.270.0060.00324.66
8.1.260.0100.01026.35
8.1.250.0070.00028.09
8.1.240.0060.00620.83
8.1.230.0080.00321.10
8.1.220.0000.00817.77
8.1.210.0000.00918.98
8.1.200.0060.00617.23
8.1.190.0050.00217.39
8.1.180.0040.00418.10
8.1.170.0000.00818.91
8.1.160.0000.00718.86
8.1.150.0000.00818.61
8.1.140.0040.00417.43
8.1.130.0000.00817.91
8.1.120.0040.00417.43
8.1.110.0000.00717.45
8.1.100.0000.00717.43
8.1.90.0000.00817.38
8.1.80.0040.00417.30
8.1.70.0000.00717.27
8.1.60.0000.00817.52
8.1.50.0090.00017.47
8.1.40.0090.00017.45
8.1.30.0000.00917.63
8.1.20.0000.00917.70
8.1.10.0000.00817.59
8.1.00.0040.00417.52
8.0.300.0040.00419.88
8.0.290.0040.00416.75
8.0.280.0040.00418.47
8.0.270.0000.00717.18
8.0.260.0080.00016.80
8.0.250.0040.00416.88
8.0.240.0000.00816.93
8.0.230.0000.00716.87
8.0.220.0000.00716.85
8.0.210.0070.00416.86
8.0.200.0030.00316.84
8.0.190.0080.00016.97
8.0.180.0040.00316.76
8.0.170.0080.00016.88
8.0.160.0000.00716.81
8.0.150.0040.00416.75
8.0.140.0040.00816.73
8.0.130.0000.00613.25
8.0.120.0030.00516.84
8.0.110.0000.00716.84
8.0.100.0070.00016.69
8.0.90.0040.00416.66
8.0.80.0060.01516.84
8.0.70.0040.00416.74
8.0.60.0000.00816.80
8.0.50.0070.00016.82
8.0.30.0150.00617.30
8.0.20.0150.00517.01
8.0.10.0020.00516.78
8.0.00.0040.01316.79
7.4.330.0040.00413.00
7.4.320.0050.00216.45
7.4.300.0000.00616.54
7.4.290.0030.00616.63
7.4.280.0030.00516.45
7.4.270.0030.00316.63
7.4.260.0000.00513.31
7.4.250.0030.00616.56
7.4.240.0020.00516.57
7.4.230.0020.00516.64
7.4.220.0030.01716.58
7.4.210.0070.00816.59
7.4.200.0000.00716.71
7.4.190.0030.00316.66
7.4.160.0130.01016.54
7.4.150.0090.00916.45
7.4.140.0100.00816.52
7.4.130.0130.00416.52
7.4.120.0110.00916.49
7.4.110.0120.00816.26
7.4.100.0070.01016.35
7.4.90.0070.01116.56
7.4.80.0100.01016.47
7.4.70.0100.00716.44
7.4.60.0080.00916.51
7.4.50.0070.00716.48
7.4.40.0040.01116.64
7.4.30.0130.00316.66
7.4.00.0070.00715.01
7.3.330.0000.00713.25
7.3.320.0000.00513.25
7.3.310.0070.00016.30
7.3.300.0030.00316.31
7.3.290.0060.01116.29
7.3.280.0090.01116.27
7.3.270.0120.00416.34
7.3.260.0080.01116.47
7.3.250.0080.01016.33
7.3.240.0100.01016.32
7.3.230.0060.01016.40
7.3.210.0070.01016.43
7.3.200.0180.00419.39
7.3.190.0070.01116.45
7.3.180.0160.00816.32
7.3.170.0120.00316.38
7.3.160.0090.00616.29
7.3.120.0000.01314.76
7.3.10.0190.00716.19
7.3.00.0130.00716.04
7.2.330.0040.01516.70
7.2.320.0090.01316.46
7.2.310.0090.01316.57
7.2.300.0100.00716.78
7.2.290.0080.00916.77
7.2.130.0210.00716.61
7.2.120.0160.00316.42
7.2.110.0130.00716.61
7.2.100.0130.00716.38
7.2.90.0070.01316.42
7.2.80.0140.00816.48
7.2.70.0120.00916.07
7.2.60.0070.01016.72
7.2.50.0120.00816.15
7.2.40.0040.01616.48
7.2.30.0090.00916.68
7.2.20.0120.00616.20
7.2.10.0100.00716.59
7.2.00.0110.00718.08
7.1.250.0110.01415.28
7.1.200.0000.01115.68
7.1.100.0040.00818.06
7.1.70.0030.00717.26
7.1.60.0090.01519.40
7.1.50.0030.01616.98
7.1.00.0070.03322.54
7.0.200.0230.00015.04
7.0.140.0070.07022.08
7.0.120.0130.03022.00
7.0.60.0100.05319.91
7.0.50.0070.06717.86
7.0.40.0070.04320.25
7.0.30.0270.08020.23
7.0.20.0270.03320.24
7.0.10.0270.04020.30
7.0.00.0030.08720.18
5.6.280.0130.06321.08
5.6.210.0270.04320.73
5.6.200.0070.08018.18
5.6.190.0100.07020.34
5.6.180.0170.04720.47
5.6.170.0330.07020.44
5.6.160.0100.08320.50
5.6.150.0070.08018.13
5.6.140.0130.04018.21
5.6.130.0000.05318.17
5.6.120.0030.06320.99
5.6.110.0130.06721.12
5.6.100.0100.04021.11
5.6.90.0030.04720.89
5.6.80.0030.04320.53
5.6.70.0300.07320.43
5.5.350.0030.05320.39
5.5.340.0070.05318.05
5.5.330.0070.08720.27
5.5.320.0230.03320.19
5.5.310.0230.05320.28
5.5.300.0070.08318.02
5.5.290.0130.06717.98
5.5.280.0030.04320.81
5.5.270.0100.08020.88
5.5.260.0100.06720.84
5.5.250.0030.04320.71
5.5.240.0170.05720.27
5.4.450.0070.08019.41
5.4.440.0000.04319.25
5.4.430.0100.04319.30
5.4.420.0070.03719.17
5.4.410.0100.04719.20
5.4.400.0130.06719.15
5.4.390.0000.05019.15
5.4.380.0000.08019.15
5.4.370.0070.07019.16
5.4.360.0000.06319.01
5.4.350.0030.08019.16
5.4.340.0070.08319.16
5.4.320.0130.03319.14
5.4.310.0070.06719.24
5.4.300.0070.06319.20
5.4.290.0000.06018.87
5.4.280.0170.07318.84
5.4.270.0030.04019.14
5.4.260.0070.03718.87
5.4.250.0030.05319.15
5.4.240.0070.06018.91
5.4.230.0100.07718.94
5.4.220.0030.04019.14
5.4.210.0170.05719.23
5.4.200.0070.05019.19
5.4.190.0070.07019.00
5.4.180.0030.06719.23
5.4.170.0030.04018.84
5.4.160.0030.04019.18
5.4.150.0000.04018.83
5.4.140.0070.06316.45
5.4.130.0000.07716.47
5.4.120.0000.07716.40
5.4.110.0030.05016.44
5.4.100.0070.04316.51
5.4.90.0130.06716.43
5.4.80.0070.03316.47
5.4.70.0100.04316.46
5.4.60.0030.06316.27
5.4.50.0030.04716.31
5.4.40.0070.06716.43
5.4.30.0170.03316.39
5.4.20.0100.04716.35
5.4.10.0000.04016.39
5.4.00.0070.05015.97
5.3.290.0070.07714.67
5.3.280.0030.05314.68
5.3.270.0030.04014.64
5.3.260.0100.03314.63
5.3.250.0000.04014.61
5.3.240.0070.05314.67
5.3.230.0100.04014.61
5.3.220.0070.05014.65
5.3.210.0100.07314.64
5.3.200.0030.04014.74
5.3.190.0100.03714.62
5.3.180.0030.04314.60
5.3.170.0030.05014.61
5.3.160.0100.07714.56
5.3.150.0000.06714.58
5.3.140.0170.06314.62
5.3.130.0070.04714.57
5.3.120.0030.06014.55
5.3.110.0030.08014.63
5.3.100.0030.04314.21
5.3.90.0030.06714.05
5.3.80.0070.07314.05
5.3.70.0070.04714.07
5.3.60.0000.04714.16
5.3.50.0000.04713.85
5.3.40.0170.03013.95
5.3.30.0100.05013.84
5.3.20.0070.06313.66
5.3.10.0070.04013.81
5.3.00.0100.07013.65
5.2.170.0070.03011.15
5.2.160.0030.06011.17
5.2.150.0000.05311.31
5.2.140.0130.02311.32
5.2.130.0030.04711.11
5.2.120.0030.06311.11
5.2.110.0000.03311.11
5.2.100.0070.04711.12
5.2.90.0030.04011.11
5.2.80.0000.03311.15
5.2.70.0070.04711.03
5.2.60.0030.05011.03
5.2.50.0100.06310.97
5.2.40.0070.04711.07
5.2.30.0030.04710.98
5.2.20.0100.05310.96
5.2.10.0030.06310.89
5.2.00.0070.06010.88
5.1.60.0000.04710.02
5.1.50.0030.0279.91
5.1.40.0000.0579.94
5.1.30.0030.02710.34
5.1.20.0030.02710.33
5.1.10.0030.05710.05
5.1.00.0070.05310.21
5.0.50.0100.0308.74
5.0.40.0000.0408.74
5.0.30.0070.0608.74
5.0.20.0030.0378.74
5.0.10.0030.0238.74
5.0.00.0030.0408.74
4.4.90.0030.0238.74
4.4.80.0000.0238.74
4.4.70.0070.0238.74
4.4.60.0000.0238.74
4.4.50.0030.0378.74
4.4.40.0000.0308.74
4.4.30.0030.0138.74
4.4.20.0070.0308.74
4.4.10.0030.0378.74
4.4.00.0030.0308.74
4.3.110.0030.0278.74
4.3.100.0030.0238.74
4.3.90.0100.0178.74
4.3.80.0000.0278.74
4.3.70.0070.0308.74
4.3.60.0030.0278.74
4.3.50.0000.0308.74
4.3.40.0070.0438.74
4.3.30.0000.0278.74
4.3.20.0000.0238.74
4.3.10.0030.0278.74
4.3.00.0070.0278.74

preferences:
45.64 ms | 401 KiB | 5 Q