3v4l.org

run code in 300+ PHP versions simultaneously
<?php class testCase { private $stores; public function doFunction($items = array(), $out ) { foreach($items as $num => $val) { if($num%2 == 0) { $out = $val; } else { $out = strtoupper($val); } /* WHY DO ALL OF THE ABOVE IF WE'RE GOING TO OVERRIDE IT WITH THIS? */ //$out = "<br />"; } return $this->store = $out; } /* PRIVATE, SO NOT ACCESSIBLE! */ private function unFunction($items = '', $out = array()) { $items = implode("<br >", $items, -1); foreach($items as $num => $val) { if($num%2 != 0) { $out[$num] = $val; } else { $out[$num] = strtlower($val); } } echo $out; } } $test = new testCase(); //echo $test -> doFunction(array_merge(range(0,25), range('a','z'))) . "<hr />"; //print_r($test -> unFunction($test->store)); echo $test->doFunction(array_merge(range(0,25)), "test"); ?>

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.0000.01918.55
8.3.50.0250.00221.15
8.3.40.0180.00018.85
8.3.30.0140.00418.67
8.3.20.0060.00318.77
8.3.10.0000.00820.65
8.3.00.0070.00417.38
8.2.180.0070.01116.63
8.2.170.0040.01122.96
8.2.160.0070.00722.12
8.2.150.0050.00324.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0080.00019.83
8.2.110.0070.00321.00
8.2.100.0030.01017.72
8.2.90.0060.00319.05
8.2.80.0000.00818.05
8.2.70.0000.00817.49
8.2.60.0060.00317.91
8.2.50.0040.00418.07
8.2.40.0040.00418.22
8.2.30.0040.00418.00
8.2.20.0000.00817.55
8.2.10.0040.00417.71
8.2.00.0070.00017.76
8.1.280.0090.00625.92
8.1.270.0000.00823.99
8.1.260.0030.00526.35
8.1.250.0050.00328.09
8.1.240.0030.00622.45
8.1.230.0080.00420.97
8.1.220.0060.00317.76
8.1.210.0040.00418.95
8.1.200.0050.00517.23
8.1.190.0040.00417.52
8.1.180.0070.00018.10
8.1.170.0030.00518.89
8.1.160.0040.00418.94
8.1.150.0040.00418.65
8.1.140.0000.00717.46
8.1.130.0000.00817.85
8.1.120.0000.00717.46
8.1.110.0080.00017.37
8.1.100.0040.00417.47
8.1.90.0000.00717.39
8.1.80.0000.00717.51
8.1.70.0080.00017.35
8.1.60.0060.00317.50
8.1.50.0040.00417.55
8.1.40.0040.00417.56
8.1.30.0000.00717.55
8.1.20.0090.00017.68
8.1.10.0000.00817.55
8.1.00.0000.00817.54
8.0.300.0000.00819.98
8.0.290.0070.00016.88
8.0.280.0030.00318.39
8.0.270.0000.00717.14
8.0.260.0000.00616.80
8.0.250.0070.00017.05
8.0.240.0050.00317.02
8.0.230.0000.00717.02
8.0.220.0060.00316.88
8.0.210.0000.00716.95
8.0.200.0060.00016.92
8.0.190.0000.00716.98
8.0.180.0040.00416.91
8.0.170.0030.00616.84
8.0.160.0060.00316.91
8.0.150.0080.00016.79
8.0.140.0070.00416.84
8.0.130.0030.00313.46
8.0.120.0000.00816.82
8.0.110.0050.00516.85
8.0.100.0050.00216.98
8.0.90.0070.00016.91
8.0.80.0110.00416.94
8.0.70.0000.00716.86
8.0.60.0000.00716.79
8.0.50.0020.00516.96
8.0.30.0130.00817.03
8.0.20.0120.00617.40
8.0.10.0030.00416.87
8.0.00.0090.00916.65
7.4.330.0000.00514.77
7.4.320.0000.00616.55
7.4.300.0060.00016.56
7.4.290.0060.00316.61
7.4.280.0070.00016.48
7.4.270.0040.00416.66
7.4.260.0000.00813.19
7.4.250.0030.00416.52
7.4.240.0000.00716.55
7.4.230.0000.00716.72
7.4.220.0110.00716.68
7.4.210.0070.00716.55
7.4.200.0070.00016.52
7.4.190.0040.00416.46
7.4.160.0090.00616.63
7.4.150.0140.00317.40
7.4.140.0080.00917.19
7.4.130.0080.00816.47
7.4.120.0110.00916.53
7.4.110.0070.01016.63
7.4.100.0180.00316.54
7.4.90.0000.01916.60
7.4.80.0130.00319.03
7.4.70.0030.01416.34
7.4.60.0030.01516.66
7.4.50.0040.00416.61
7.4.40.0140.00422.27
7.4.30.0110.00616.62
7.4.00.0000.01414.85
7.3.330.0040.00413.25
7.3.320.0030.00313.39
7.3.310.0070.00016.27
7.3.300.0030.00316.32
7.3.290.0070.00716.28
7.3.280.0080.00616.39
7.3.270.0150.00317.40
7.3.260.0060.01218.24
7.3.250.0110.01116.34
7.3.240.0100.00716.53
7.3.230.0090.00916.40
7.3.210.0080.00816.69
7.3.200.0080.01119.39
7.3.190.0100.01016.49
7.3.180.0100.01016.30
7.3.170.0080.01216.43
7.3.160.0060.00916.31
7.3.120.0090.00614.83
7.2.330.0100.00716.76
7.2.320.0130.01016.65
7.2.310.0100.00716.77
7.2.300.0070.01116.71
7.2.290.0100.00716.56
7.2.00.0070.00719.48
7.1.200.0060.00915.72
7.1.100.0000.01218.12
7.1.70.0100.00717.09
7.1.60.0040.02219.40
7.1.50.0050.00516.63
7.1.00.0030.06722.57
7.0.200.0180.01416.76
7.0.140.0000.07722.01
7.0.60.0130.07719.91
7.0.50.0070.08317.95
7.0.40.0100.07320.08
7.0.30.0300.07320.07
7.0.20.0230.04020.30
7.0.10.0200.08320.33
7.0.00.0030.07320.05
5.6.280.0070.06321.12
5.6.210.0030.04020.45
5.6.200.0000.04718.22
5.6.190.0070.06020.45
5.6.180.0270.04720.46
5.6.170.0300.07320.47
5.6.160.0100.08320.71
5.6.150.0130.08018.19
5.6.140.0070.03718.27
5.6.130.0100.08318.15
5.6.120.0070.06021.00
5.6.110.0000.08321.13
5.6.100.0170.07721.11
5.6.90.0100.08721.00
5.6.80.0100.07720.33
5.6.70.0170.05020.39
5.5.350.0200.04720.42
5.5.340.0030.04318.02
5.5.330.0070.04020.21
5.5.320.0070.07720.44
5.5.310.0170.03720.27
5.5.300.0030.08717.95
5.5.290.0100.06318.06
5.5.280.0070.04320.81
5.5.270.0030.04320.80
5.5.260.0100.05020.89
5.5.250.0100.05320.62
5.5.240.0030.03720.16
5.4.450.0270.07019.29
5.4.440.0370.07319.32
5.4.430.0370.07719.48
5.4.420.0400.04319.19
5.4.410.0370.03719.26
5.4.400.0230.05319.11
5.4.390.0430.06319.09
5.4.380.0330.03718.88
5.4.370.0470.05319.06
5.4.360.0370.04318.92
5.4.350.0400.04719.08
5.4.340.0330.05018.98
5.4.320.0330.05019.16
5.4.310.0530.05318.93
5.4.300.0300.05019.06
5.4.290.0400.06718.99
5.4.280.0370.04718.85
5.4.270.0400.06019.08
5.4.260.0430.06718.99
5.4.250.0370.07318.96
5.4.240.0300.05319.05
5.4.230.0270.06018.84
5.4.220.0400.07319.11
5.4.210.0430.06318.91
5.4.200.0400.05718.86
5.4.190.0400.06719.12
5.4.180.0400.06719.04
5.4.170.0370.07019.05
5.4.160.0430.06318.90
5.4.150.0370.06719.03
5.4.140.0470.06016.36
5.4.130.0430.05016.50
5.4.120.0270.05016.36
5.4.110.0430.06016.45
5.4.100.0270.03716.28
5.4.90.0430.03716.53
5.4.80.0330.05016.26
5.4.70.0370.05316.55
5.4.60.0430.07016.23
5.4.50.0470.05716.16
5.4.40.0400.06016.43
5.4.30.0430.05716.33
5.4.20.0430.03716.47
5.4.10.0300.06716.42
5.4.00.0330.03715.95
5.3.290.0230.04314.59
5.3.280.0330.05014.57
5.3.270.0400.07014.73
5.3.260.0470.06014.83
5.3.250.0500.04714.62
5.3.240.0430.06714.51
5.3.230.0370.04014.63
5.3.220.0300.04314.55
5.3.210.0330.05014.50
5.3.200.0330.04014.66
5.3.190.0300.05714.73
5.3.180.0330.03714.50
5.3.170.0330.04014.54
5.3.160.0400.06314.79
5.3.150.0330.08014.59
5.3.140.0370.05714.61
5.3.130.0300.04014.71
5.3.120.0330.07314.79
5.3.110.0400.06714.55
5.3.100.0370.03014.16
5.3.90.0400.06314.11
5.3.80.0400.04713.94
5.3.70.0300.05313.93
5.3.60.0370.07014.01
5.3.50.0430.05013.98
5.3.40.0330.07014.05
5.3.30.0370.05013.94
5.3.20.0330.04313.60
5.3.10.0330.04713.75
5.3.00.0330.05313.67
5.2.170.0300.06311.14
5.2.160.0370.05011.07
5.2.150.0330.03011.39
5.2.140.0530.01711.38
5.2.130.0370.04711.04
5.2.120.0330.05311.12
5.2.110.0330.06011.04
5.2.100.0200.04311.03
5.2.90.0300.06311.09
5.2.80.0370.03311.19
5.2.70.0300.05311.21
5.2.60.0270.03311.01
5.2.50.0230.04311.11
5.2.40.0200.06011.12
5.2.30.0200.03010.88
5.2.20.0270.03711.12
5.2.10.0230.05710.94
5.2.00.0230.03310.68
5.1.60.0130.03010.08
5.1.50.0130.03310.16
5.1.40.0200.02310.07
5.1.30.0230.03710.24
5.1.20.0200.03010.53
5.1.10.0230.0509.97
5.1.00.0300.0439.96
5.0.50.0100.0238.64
5.0.40.0100.0178.56
5.0.30.0100.0308.36
5.0.20.0130.0238.11
5.0.10.0170.0138.08
5.0.00.0100.0378.40
4.4.90.0130.0307.83
4.4.80.0100.0377.83
4.4.70.0070.0177.83
4.4.60.0130.0107.83
4.4.50.0100.0137.83
4.4.40.0130.0377.83
4.4.30.0100.0177.83
4.4.20.0100.0377.83
4.4.10.0130.0177.83
4.4.00.0100.0237.83
4.3.110.0200.0277.83
4.3.100.0130.0137.83
4.3.90.0130.0207.83
4.3.80.0170.0377.83
4.3.70.0130.0237.83
4.3.60.0130.0237.83
4.3.50.0130.0207.83
4.3.40.0130.0437.83
4.3.30.0030.0237.83
4.3.20.0100.0237.83
4.3.10.0130.0177.83
4.3.00.0130.0137.83

preferences:
45.13 ms | 401 KiB | 5 Q