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.. // call parent (Base::doSomething()) $something = parent::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.0030.01318.39
8.3.50.0150.00721.21
8.3.40.0170.00319.02
8.3.30.0070.00718.85
8.3.20.0040.00418.48
8.3.10.0000.00919.16
8.3.00.0000.00723.58
8.2.180.0140.00716.63
8.2.170.0070.00722.96
8.2.160.0070.00720.35
8.2.150.0080.00024.18
8.2.140.0050.00324.66
8.2.130.0040.00426.16
8.2.120.0000.00721.11
8.2.110.0030.00622.10
8.2.100.0060.00617.91
8.2.90.0030.00519.21
8.2.80.0040.00417.97
8.2.70.0000.00817.63
8.2.60.0080.00517.91
8.2.50.0080.00018.07
8.2.40.0040.00418.28
8.2.30.0060.00319.86
8.2.20.0070.00017.76
8.2.10.0040.00417.66
8.2.00.0040.00417.85
8.1.280.0090.00925.92
8.1.270.0070.00023.99
8.1.260.0060.00326.35
8.1.250.0070.00028.09
8.1.240.0070.00322.46
8.1.230.0060.00620.92
8.1.220.0040.00418.77
8.1.210.0080.00018.96
8.1.200.0060.00317.35
8.1.190.0040.00417.41
8.1.180.0000.00818.10
8.1.170.0000.00818.46
8.1.160.0040.00418.84
8.1.150.0000.00718.54
8.1.140.0000.00717.27
8.1.130.0050.00317.80
8.1.120.0000.00817.46
8.1.110.0030.00517.39
8.1.100.0000.00817.43
8.1.90.0000.00717.41
8.1.80.0030.00517.37
8.1.70.0030.00617.43
8.1.60.0000.00817.60
8.1.50.0030.00517.49
8.1.40.0030.00517.42
8.1.30.0040.00417.57
8.1.20.0030.00517.70
8.1.10.0000.00717.48
8.1.00.0050.00317.40
8.0.300.0040.00419.86
8.0.290.0020.00517.16
8.0.280.0070.00018.45
8.0.270.0000.00717.17
8.0.260.0030.00316.68
8.0.250.0000.00716.93
8.0.240.0000.00817.02
8.0.230.0040.00416.82
8.0.220.0030.00316.75
8.0.210.0000.00816.85
8.0.200.0060.00016.93
8.0.190.0070.00016.91
8.0.180.0000.00716.84
8.0.170.0030.00316.76
8.0.160.0000.00716.74
8.0.150.0030.00616.73
8.0.140.0040.00416.84
8.0.130.0030.00313.27
8.0.120.0000.00716.83
8.0.110.0060.00216.68
8.0.100.0050.00216.75
8.0.90.0040.00416.88
8.0.80.0030.01116.87
8.0.70.0070.00016.72
8.0.60.0000.00716.79
8.0.50.0030.00516.87
8.0.30.0090.01117.09
8.0.20.0080.01117.40
8.0.10.0050.00317.01
8.0.00.0070.01116.82
7.4.330.0070.00013.43
7.4.320.0030.00316.61
7.4.300.0000.00716.50
7.4.290.0040.00416.45
7.4.280.0000.01216.55
7.4.270.0040.00416.60
7.4.260.0050.00013.29
7.4.250.0040.00416.63
7.4.240.0040.00416.37
7.4.230.0000.00716.49
7.4.220.0100.01316.58
7.4.210.0060.00816.53
7.4.200.0000.00716.52
7.4.190.0070.00016.72
7.4.160.0100.00616.25
7.4.150.0030.01617.40
7.4.140.0090.00817.86
7.4.130.0130.00816.60
7.4.120.0130.00516.38
7.4.110.0160.00016.39
7.4.100.0070.01016.50
7.4.90.0100.00716.47
7.4.80.0100.01019.37
7.4.70.0110.00716.64
7.4.60.0060.01216.47
7.4.50.0080.00016.49
7.4.40.0070.01022.27
7.4.30.0110.00716.26
7.4.10.0130.00614.73
7.4.00.0070.01014.79
7.3.330.0000.00513.21
7.3.320.0020.00213.18
7.3.310.0030.00316.27
7.3.300.0030.00316.15
7.3.290.0140.00816.28
7.3.280.0040.01116.19
7.3.270.0140.00317.40
7.3.260.0110.00718.24
7.3.250.0100.01116.19
7.3.240.0160.00016.30
7.3.230.0090.01216.39
7.3.210.0090.01016.31
7.3.200.0100.00719.39
7.3.190.0090.00916.41
7.3.180.0100.00716.38
7.3.170.0110.00616.27
7.3.160.0180.00316.52
7.3.130.0100.00614.91
7.3.120.0100.00714.80
7.3.110.0060.00914.66
7.3.100.0090.00714.61
7.3.90.0070.00814.71
7.3.80.0090.00714.75
7.3.70.0080.00614.69
7.3.60.0080.00514.77
7.3.50.0090.00614.72
7.3.40.0060.00814.72
7.3.30.0040.00814.65
7.3.20.0080.00616.63
7.3.10.0080.00616.48
7.3.00.0050.00716.56
7.2.330.0100.00716.79
7.2.320.0000.01616.37
7.2.310.0130.00316.72
7.2.300.0110.00516.57
7.2.290.0080.00816.72
7.2.260.0070.01115.10
7.2.250.0030.01315.23
7.2.240.0080.00715.02
7.2.230.0060.00815.05
7.2.220.0050.01115.14
7.2.210.0060.00915.02
7.2.200.0060.01014.95
7.2.190.0060.00915.03
7.2.180.0040.00915.02
7.2.170.0050.00914.93
7.2.160.0080.00814.93
7.2.150.0080.00716.89
7.2.140.0070.00916.90
7.2.130.0060.00616.96
7.2.120.0030.01116.73
7.2.110.0030.01116.91
7.2.100.0050.01016.90
7.2.90.0070.00917.02
7.2.80.0070.00416.63
7.2.70.0070.01016.83
7.2.60.0060.00916.68
7.2.50.0030.01016.86
7.2.40.0070.00616.92
7.2.30.0070.00916.89
7.2.20.0050.01016.86
7.2.10.0040.00916.86
7.2.00.0080.00516.80
7.1.330.0070.00815.65
7.1.320.0090.00815.78
7.1.310.0060.00815.70
7.1.300.0130.00515.62
7.1.290.0040.00615.72
7.1.280.0080.00615.75
7.1.270.0050.00715.66
7.1.260.0070.00615.72
7.1.250.0040.00715.71
7.1.240.0000.01015.48
7.1.230.0000.00915.92
7.1.220.0040.00815.84
7.1.210.0070.00715.89
7.1.200.0070.00715.73
7.1.190.0000.01415.73
7.1.180.0000.00915.73
7.1.170.0070.00715.70
7.1.160.0030.00915.71
7.1.150.0000.01215.50
7.1.140.0060.01215.93
7.1.130.0090.00615.75
7.1.120.0080.00415.44
7.1.110.0060.00315.73
7.1.100.0050.00916.79
7.1.90.0030.01015.75
7.1.80.0060.00315.57
7.1.70.0030.01016.37
7.1.60.0110.00917.65
7.1.50.0060.01416.20
7.1.40.0080.00615.84
7.1.30.0050.00515.61
7.1.20.0070.00415.75
7.1.10.0030.00915.71
7.1.00.0030.03519.13
7.0.330.0070.00315.45
7.0.320.0000.01015.45
7.0.310.0000.01415.18
7.0.300.0070.00715.39
7.0.290.0030.00715.39
7.0.280.0070.00715.21
7.0.270.0070.01015.30
7.0.260.0110.00415.26
7.0.250.0060.00915.58
7.0.240.0000.01115.46
7.0.230.0000.01015.52
7.0.220.0060.00315.37
7.0.210.0120.00015.29
7.0.200.0030.00615.83
7.0.190.0080.01115.10
7.0.180.0000.01415.46
7.0.170.0070.00715.40
7.0.160.0030.01015.27
7.0.150.0030.00915.48
7.0.140.0080.03618.68
7.0.130.0100.00315.43
7.0.120.0030.00615.07
7.0.110.0040.01115.29
7.0.100.0040.01115.43
7.0.90.0030.00915.52
7.0.80.0040.00715.32
7.0.70.0080.04018.43
7.0.60.0060.03318.57
7.0.50.0040.03918.74
7.0.40.0050.04316.88
7.0.30.0100.04016.77
7.0.20.0020.02916.76
7.0.10.0050.04216.69
7.0.00.0040.04416.83
5.6.400.0040.00814.28
5.6.390.0000.00914.61
5.6.380.0070.00714.41
5.6.370.0080.00414.30
5.6.360.0060.00314.53
5.6.350.0090.00614.40
5.6.340.0070.00714.66
5.6.330.0090.00014.56
5.6.320.0090.00314.05
5.6.310.0150.00314.71
5.6.300.0000.01114.16
5.6.290.0030.00714.43
5.6.280.0040.03717.68
5.6.270.0090.00614.46
5.6.260.0070.00714.37
5.6.250.0030.01014.32
5.6.240.0070.01114.43
5.6.230.0060.00914.25
5.6.220.0030.00614.31
5.6.210.0070.04417.50
5.6.200.0030.03317.74
5.6.190.0070.04017.71
5.6.180.0010.04817.70
5.6.170.0000.04117.74
5.6.160.0060.04617.71
5.6.150.0040.03917.79
5.6.140.0070.03217.72
5.6.130.0070.04017.77
5.6.120.0020.03417.72
5.6.110.0020.02717.67
5.6.100.0080.04017.71
5.6.90.0070.04217.75
5.6.80.0080.04217.28
5.6.70.0060.03317.22
5.6.60.0020.05017.33
5.6.50.0070.04017.19
5.6.40.0030.04617.41
5.6.30.0030.04017.33
5.6.20.0020.04017.38
5.6.10.0090.03717.28
5.6.00.0050.03217.40
5.5.380.0030.01114.57
5.5.370.0060.00914.34
5.5.360.0090.00614.40
5.5.350.0030.03917.40
5.5.340.0100.04217.36
5.5.330.0050.04217.56
5.5.320.0040.04717.67
5.5.310.0060.02417.67
5.5.300.0020.03917.57
5.5.290.0080.03317.60
5.5.280.0050.03917.50
5.5.270.0040.04417.58
5.5.260.0030.04717.52
5.5.250.0070.03817.71
5.5.240.0050.03117.31
5.5.230.0030.03817.23
5.5.220.0020.02617.36
5.5.210.0040.03917.14
5.5.200.0090.03517.08
5.5.190.0030.04817.29
5.5.180.0080.03417.19
5.5.170.0030.01313.84
5.5.160.0050.04217.35
5.5.150.0030.04417.28
5.5.140.0030.04217.24
5.5.130.0030.04217.25
5.5.120.0110.02217.19
5.5.110.0100.03317.20
5.5.100.0020.03717.11
5.5.90.0090.03817.17
5.5.80.0050.04317.08
5.5.70.0050.04217.16
5.5.60.0030.04717.25
5.5.50.0090.02717.25
5.5.40.0040.04217.12
5.5.30.0030.04617.14
5.5.20.0120.03517.09
5.5.10.0020.04317.08
5.5.00.0020.04517.31
5.4.450.0070.03516.02
5.4.440.0030.04015.99
5.4.430.0080.03815.99
5.4.420.0060.04215.93
5.4.410.0070.04015.92
5.4.400.0070.03815.68
5.4.390.0060.05015.69
5.4.380.0030.03215.77
5.4.370.0050.03815.71
5.4.360.0030.04215.74
5.4.350.0020.04515.83
5.4.340.0030.03315.68
5.4.330.0000.00812.50
5.4.320.0020.04115.68
5.4.310.0060.03415.87
5.4.300.0030.04015.81
5.4.290.0050.03915.84
5.4.280.0120.03315.86
5.4.270.0030.03715.87
5.4.260.0050.03915.81
5.4.250.0000.03515.76
5.4.240.0050.04115.76
5.4.230.0030.04115.84
5.4.220.0020.04415.77
5.4.210.0030.03415.67
5.4.200.0030.04215.76
5.4.190.0070.03315.81
5.4.180.0070.03715.72
5.4.170.0040.04015.68
5.4.160.0040.04315.68
5.4.150.0050.04315.80
5.4.140.0050.04014.42
5.4.130.0030.04014.46
5.4.120.0040.03314.42
5.4.110.0030.03314.52
5.4.100.0030.03814.50
5.4.90.0000.03814.46
5.4.80.0050.02514.44
5.4.70.0050.03614.50
5.4.60.0070.02714.40
5.4.50.0040.03514.46
5.4.40.0050.04014.43
5.4.30.0030.03514.46
5.4.20.0030.02514.47
5.4.10.0020.02914.48
5.4.00.0070.03314.16
5.3.290.0050.04013.62
5.3.280.0100.03313.56
5.3.270.0020.04313.61
5.3.260.0050.04113.55
5.3.250.0070.03513.59
5.3.240.0030.04013.57
5.3.230.0010.02813.54
5.3.220.0000.04513.57
5.3.210.0050.03613.57
5.3.200.0060.03813.57
5.3.190.0050.04013.53
5.3.180.0050.02513.53
5.3.170.0020.03013.53
5.3.160.0050.03613.55
5.3.150.0030.03613.59
5.3.140.0050.03813.56
5.3.130.0060.04013.60
5.3.120.0080.03613.59
5.3.110.0030.03613.56
5.3.100.0030.04013.27
5.3.90.0050.03313.29
5.3.80.0030.03513.22
5.3.70.0090.03613.22
5.3.60.0030.03313.22
5.3.50.0030.03413.18
5.3.40.0030.02513.22
5.3.30.0050.03113.24
5.3.20.0080.03313.17
5.3.10.0050.03913.09
5.3.00.0000.03813.07
5.2.170.0000.06311.04
5.2.160.0070.04711.14
5.2.150.0030.03311.21
5.2.140.0070.04011.27
5.2.130.0070.05711.16
5.2.120.0070.05711.21
5.2.110.0000.06011.13
5.2.100.0070.06311.11
5.2.90.0070.05711.16
5.2.80.0000.06311.21
5.2.70.0030.05710.96
5.2.60.0000.06711.12
5.2.50.0000.06310.89
5.2.40.0070.04711.13
5.2.30.0070.05711.04
5.2.20.0000.05710.91
5.2.10.0170.04711.01
5.2.00.0000.06310.84
5.1.60.0000.0509.88
5.1.50.0030.0509.99
5.1.40.0070.0479.98
5.1.30.0030.05710.34
5.1.20.0000.05310.41
5.1.10.0100.04710.17
5.1.00.0000.05710.20
5.0.50.0070.0408.55
5.0.40.0000.0438.41
5.0.30.0100.0608.32
5.0.20.0000.0478.28
5.0.10.0000.0438.22
5.0.00.0030.0638.16
4.4.90.0030.0338.07
4.4.80.0000.0338.07
4.4.70.0000.0378.07
4.4.60.0000.0278.07
4.4.50.0000.0338.07
4.4.40.0030.0538.07
4.4.30.0000.0338.07
4.4.20.0070.0308.07
4.4.10.0000.0378.07
4.4.00.0030.0508.07
4.3.110.0000.0338.07
4.3.100.0030.0308.07
4.3.90.0100.0278.07
4.3.80.0000.0538.07
4.3.70.0030.0278.07
4.3.60.0070.0308.07
4.3.50.0030.0308.07
4.3.40.0070.0438.07
4.3.30.0000.0408.07
4.3.20.0000.0338.07
4.3.10.0030.0338.07
4.3.00.0000.0308.07

preferences:
51.08 ms | 401 KiB | 5 Q