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); } $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.0080.00818.80
8.3.50.0110.00622.05
8.3.40.0140.00018.98
8.3.30.0030.01019.07
8.3.20.0060.00320.29
8.3.10.0000.00821.86
8.3.00.0080.00022.43
8.2.180.0070.00716.88
8.2.170.0070.01422.96
8.2.160.0100.00320.53
8.2.150.0000.00824.18
8.2.140.0000.00824.66
8.2.130.0060.01026.16
8.2.120.0030.00719.48
8.2.110.0030.00622.26
8.2.100.0040.00719.70
8.2.90.0000.00819.09
8.2.80.0000.00817.97
8.2.70.0080.00017.50
8.2.60.0040.00418.03
8.2.50.0040.00418.07
8.2.40.0050.00318.16
8.2.30.0070.00017.99
8.2.20.0040.00417.68
8.2.10.0060.00319.44
8.2.00.0030.00617.75
8.1.280.0150.00025.92
8.1.270.0050.00322.07
8.1.260.0070.00026.35
8.1.250.0040.00428.09
8.1.240.0000.00923.83
8.1.230.0070.00419.22
8.1.220.0000.00817.74
8.1.210.0000.00818.77
8.1.200.0100.00017.35
8.1.190.0040.00417.52
8.1.180.0040.00418.10
8.1.170.0040.00418.55
8.1.160.0040.00421.91
8.1.150.0030.00518.66
8.1.140.0000.00717.47
8.1.130.0080.00017.86
8.1.120.0040.00417.52
8.1.110.0040.00417.45
8.1.100.0040.00417.46
8.1.90.0030.00517.45
8.1.80.0000.00717.41
8.1.70.0050.00317.46
8.1.60.0070.00317.59
8.1.50.0040.00417.53
8.1.40.0030.00617.38
8.1.30.0000.00817.55
8.1.20.0040.00417.72
8.1.10.0040.00417.57
8.1.00.0040.00417.53
8.0.300.0030.00618.77
8.0.290.0050.00217.18
8.0.280.0030.00418.51
8.0.270.0050.00217.23
8.0.260.0030.00316.82
8.0.250.0030.00317.06
8.0.240.0100.00017.08
8.0.230.0040.00416.94
8.0.220.0030.00316.86
8.0.210.0000.00816.86
8.0.200.0060.00016.96
8.0.190.0000.00716.93
8.0.180.0050.00316.96
8.0.170.0040.00416.92
8.0.160.0040.00416.94
8.0.150.0040.00416.81
8.0.140.0040.00416.96
8.0.130.0030.00313.36
8.0.120.0040.00416.87
8.0.110.0050.00316.83
8.0.100.0000.00716.91
8.0.90.0000.00716.87
8.0.80.0080.00816.98
8.0.70.0040.00417.01
8.0.60.0000.00716.88
8.0.50.0040.00416.92
8.0.30.0110.00817.21
8.0.20.0080.01017.40
8.0.10.0050.00317.08
8.0.00.0120.00916.96
7.4.330.0060.00015.00
7.4.320.0000.00616.58
7.4.300.0000.00616.53
7.4.290.0000.00716.53
7.4.280.0000.00716.47
7.4.270.0000.00716.63
7.4.260.0030.00316.41
7.4.250.0000.00716.41
7.4.240.0050.00216.56
7.4.230.0050.00316.69
7.4.220.0160.00016.51
7.4.210.0100.00516.68
7.4.200.0030.00316.52
7.4.190.0030.00616.48
7.4.160.0070.01016.47
7.4.150.0090.00917.40
7.4.140.0070.01217.86
7.4.130.0110.00916.51
7.4.120.0100.00816.63
7.4.110.0070.01116.52
7.4.100.0100.00716.37
7.4.90.0090.00916.58
7.4.80.0120.00619.39
7.4.70.0090.00916.33
7.4.60.0060.01216.55
7.4.50.0040.00016.52
7.4.40.0030.01222.77
7.4.30.0070.01016.75
7.4.00.0040.01114.61
7.3.330.0000.00513.21
7.3.320.0060.00013.24
7.3.310.0070.00016.41
7.3.300.0000.00716.34
7.3.290.0040.01116.30
7.3.280.0070.01116.41
7.3.270.0070.01017.40
7.3.260.0140.00916.45
7.3.250.0080.01116.40
7.3.240.0030.01416.66
7.3.230.0100.00716.39
7.3.210.0000.01816.46
7.3.200.0060.01219.39
7.3.190.0120.00916.56
7.3.180.0060.00916.63
7.3.170.0100.00716.39
7.3.160.0100.00516.30
7.3.120.0090.00615.02
7.2.330.0080.01616.51
7.2.320.0060.01216.49
7.2.310.0100.00716.79
7.2.300.0160.00016.71
7.2.290.0070.01016.66
7.2.00.0060.00619.42
7.1.100.0060.00618.16
7.1.70.0030.00516.75
7.1.60.0100.00719.82
7.1.50.0040.01816.96
7.1.00.0070.07322.35
7.0.200.0040.00416.73
7.0.140.0000.07022.09
7.0.60.0030.04320.03
7.0.50.0070.05017.93
7.0.40.0130.08020.05
7.0.30.0570.06720.20
7.0.20.0370.07320.09
7.0.10.0070.07320.24
7.0.00.0070.04720.20
5.6.280.0100.06721.13
5.6.210.0100.07320.73
5.6.200.0130.08018.25
5.6.190.0100.05720.50
5.6.180.0270.04020.63
5.6.170.0300.07320.47
5.6.160.0130.07020.33
5.6.150.0130.07318.11
5.6.140.0000.08718.13
5.6.130.0070.04718.22
5.6.120.0030.08720.96
5.6.110.0030.04021.12
5.6.100.0000.04721.03
5.6.90.0070.07321.03
5.6.80.0130.04320.36
5.5.350.0330.04320.47
5.5.340.0100.08018.07
5.5.330.0070.03720.56
5.5.320.0230.08320.41
5.5.310.0330.07020.30
5.5.300.0100.05317.98
5.5.290.0030.06018.04
5.5.280.0070.06320.89
5.5.270.0100.07320.67
5.5.260.0170.04020.80
5.5.250.0070.04320.63
5.5.240.0070.06320.17
5.4.450.0700.03719.55
5.4.440.0900.04019.27
5.4.430.0900.04719.55
5.4.420.0770.06319.39
5.4.410.0500.05019.54
5.4.400.0670.04718.99
5.4.390.0700.04718.89
5.4.380.0370.06318.63
5.4.370.0230.06718.48
5.4.360.0530.04718.73
5.4.350.0230.05318.80
5.4.340.0230.07018.70
5.4.320.0050.04412.50
5.4.310.0050.04612.50
5.4.300.0050.03812.50
5.4.290.0020.04212.50
5.4.280.0050.03612.39
5.4.270.0100.05018.96
5.4.260.0130.05318.78
5.4.250.0170.05018.96
5.4.240.0070.05319.02
5.4.230.0200.04718.90
5.4.220.0030.08018.75
5.4.210.0070.05318.90
5.4.200.0170.08318.80
5.4.190.0200.05018.91
5.4.180.0100.07718.99
5.4.170.0100.08319.01
5.4.160.0000.06018.89
5.4.150.0130.07018.92
5.4.140.0100.07316.39
5.4.130.0200.04716.44
5.4.120.0100.05716.38
5.4.110.0130.05316.53
5.4.100.0100.05716.41
5.4.90.0130.04716.46
5.4.80.0130.07716.39
5.4.70.0100.07716.63
5.4.60.0130.04316.39
5.4.50.0000.07016.44
5.4.40.0100.05316.47
5.4.30.0130.05016.45
5.4.20.0130.06016.49
5.4.10.0030.06016.44
5.4.00.0030.06716.03
5.3.290.0070.03712.80
5.3.280.0200.06014.83
5.3.270.0030.06314.70
5.3.260.0070.07314.84
5.3.250.0070.07314.84
5.3.240.0070.07314.71
5.3.230.0070.05014.82
5.3.220.0070.05714.74
5.3.210.0170.05714.59
5.3.200.0170.06314.59
5.3.190.0100.06014.57
5.3.180.0130.07014.71
5.3.170.0070.05714.66
5.3.160.0130.05314.54
5.3.150.0100.04714.75
5.3.140.0070.05314.55
5.3.130.0270.05714.55
5.3.120.0100.05014.72
5.3.110.0170.06714.54
5.3.100.0070.06314.18
5.3.90.0000.05714.16
5.3.80.0170.05713.93
5.3.70.0100.07014.04
5.3.60.0170.06314.07
5.3.50.0100.05013.96
5.3.40.0070.07013.98
5.3.30.0070.05013.90
5.3.20.0070.06313.72
5.3.10.0130.05713.63
5.3.00.0070.07313.80
5.2.170.0070.06011.11
5.2.160.0070.04011.23
5.2.150.0130.03310.99
5.2.140.0100.04311.10
5.2.130.0070.04011.20
5.2.120.0070.04011.08
5.2.110.0100.03711.11
5.2.100.0100.05011.27
5.2.90.0130.04010.94
5.2.80.0070.04010.93
5.2.70.0070.05711.16
5.2.60.0030.06311.05
5.2.50.0070.06310.86
5.2.40.0070.04011.10
5.2.30.0130.04710.98
5.2.20.0100.03711.05
5.2.10.0130.04710.82
5.2.00.0030.05010.82
5.1.60.0100.0439.96
5.1.50.0100.04310.07
5.1.40.0030.0509.91
5.1.30.0070.05010.41
5.1.20.0100.04710.54
5.1.10.0000.04010.10
5.1.00.0070.04710.07
5.0.50.0070.0378.62
5.0.40.0000.0378.47
5.0.30.0100.0508.35
5.0.20.0030.0378.12
5.0.10.0030.0278.10
5.0.00.0070.0408.09
4.4.90.0000.0275.83
4.4.80.0030.0235.81
4.4.70.0100.0175.82
4.4.60.0070.0275.86
4.4.50.0000.0235.86
4.4.40.0000.0405.81
4.4.30.0070.0235.82
4.4.20.0030.0235.96
4.4.10.0000.0305.88
4.4.00.0100.0275.78
4.3.110.0100.0305.75
4.3.100.0030.0235.77
4.3.90.0030.0235.66
4.3.80.0000.0405.81
4.3.70.0030.0275.73
4.3.60.0000.0235.76
4.3.50.0000.0305.73
4.3.40.0070.0375.68
4.3.30.0030.0235.62
4.3.20.0000.0235.62
4.3.10.0000.0305.62
4.3.00.0170.02015.57

preferences:
40.31 ms | 401 KiB | 5 Q