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! FIX: make public */ 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; } } class testCase1 { private $stores; public function doFunction($items) { foreach($items as $num => $val) { if($num % 2 === 0) { $out += $val; } else { $out += strtoupper($val); } $out += "<br />"; } return $this->store = $out; } 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 testCase1(); 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"); /* seems like the two functions are about: doing something and undoing that. */ ?>

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.0180.00318.68
8.3.50.0150.00721.99
8.3.40.0150.00019.00
8.3.30.0100.00719.22
8.3.20.0000.00820.21
8.3.10.0000.00821.94
8.3.00.0040.00422.37
8.2.180.0040.01116.75
8.2.170.0070.00722.96
8.2.160.0130.00722.31
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0090.00026.16
8.2.120.0070.00317.88
8.2.110.0080.00022.13
8.2.100.0110.00018.03
8.2.90.0060.00319.30
8.2.80.0040.00417.97
8.2.70.0030.00817.48
8.2.60.0000.00817.93
8.2.50.0040.00418.07
8.2.40.0040.00418.28
8.2.30.0050.00318.21
8.2.20.0080.00017.84
8.2.10.0060.00319.73
8.2.00.0030.00617.83
8.1.280.0100.01025.92
8.1.270.0080.00022.09
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0070.01124.01
8.1.230.0080.00418.92
8.1.220.0000.00817.77
8.1.210.0000.00918.77
8.1.200.0030.00717.35
8.1.190.0080.00017.52
8.1.180.0030.00618.10
8.1.170.0080.00018.46
8.1.160.0000.00721.91
8.1.150.0060.00318.66
8.1.140.0060.00317.55
8.1.130.0000.00717.84
8.1.120.0030.00517.39
8.1.110.0040.00417.45
8.1.100.0000.00717.46
8.1.90.0000.00717.46
8.1.80.0000.00817.54
8.1.70.0000.00717.41
8.1.60.0040.00417.64
8.1.50.0030.00517.50
8.1.40.0000.00817.42
8.1.30.0060.00317.71
8.1.20.0080.00017.61
8.1.10.0060.00317.61
8.1.00.0050.00217.39
8.0.300.0040.00418.77
8.0.290.0000.00816.91
8.0.280.0000.00818.34
8.0.270.0040.00417.19
8.0.260.0000.00716.90
8.0.250.0080.00016.88
8.0.240.0040.00416.94
8.0.230.0040.00416.96
8.0.220.0040.00216.93
8.0.210.0050.00316.93
8.0.200.0030.00317.04
8.0.190.0040.00416.98
8.0.180.0070.00017.02
8.0.170.0000.00817.05
8.0.160.0040.00416.99
8.0.150.0000.00716.95
8.0.140.0040.00417.00
8.0.130.0030.00613.36
8.0.120.0040.00416.84
8.0.110.0040.00416.95
8.0.100.0030.00616.86
8.0.90.0040.00416.86
8.0.80.0160.00016.94
8.0.70.0040.00416.78
8.0.60.0050.00216.99
8.0.50.0070.00017.00
8.0.30.0140.00817.28
8.0.20.0110.00817.40
8.0.10.0050.00316.89
8.0.00.0150.00616.68
7.4.330.0040.00415.00
7.4.320.0000.00616.64
7.4.300.0000.00616.50
7.4.290.0090.00016.57
7.4.280.0030.00316.45
7.4.270.0030.00316.67
7.4.260.0000.00716.49
7.4.250.0040.00416.41
7.4.240.0020.00516.52
7.4.230.0000.00716.65
7.4.220.0130.00616.66
7.4.210.0090.00716.62
7.4.200.0040.00416.61
7.4.190.0040.00416.58
7.4.160.0090.00616.44
7.4.150.0070.01117.40
7.4.140.0110.00917.86
7.4.130.0130.00916.52
7.4.120.0110.00816.58
7.4.110.0120.00916.52
7.4.100.0150.00416.72
7.4.90.0090.00916.52
7.4.80.0040.01219.39
7.4.70.0170.00016.41
7.4.60.0070.01016.61
7.4.50.0000.00916.70
7.4.40.0090.00622.77
7.4.30.0060.01016.81
7.4.00.0040.01115.06
7.3.330.0030.00313.45
7.3.320.0060.00013.46
7.3.310.0030.00316.26
7.3.300.0000.00716.50
7.3.290.0130.00716.37
7.3.280.0060.01016.41
7.3.270.0100.00717.40
7.3.260.0160.01016.46
7.3.250.0090.01016.38
7.3.240.0060.01216.58
7.3.230.0120.00616.54
7.3.210.0150.00916.54
7.3.200.0000.01719.39
7.3.190.0070.01116.35
7.3.180.0100.00616.37
7.3.170.0100.01016.47
7.3.160.0080.00816.58
7.3.120.0070.01014.89
7.3.10.0050.00816.47
7.3.00.0040.00816.73
7.2.330.0070.01116.86
7.2.320.0110.00816.73
7.2.310.0080.00816.51
7.2.300.0060.01216.68
7.2.290.0070.01016.38
7.2.130.0140.00016.97
7.2.120.0040.01116.97
7.2.110.0100.00617.12
7.2.100.0000.01116.67
7.2.90.0070.00717.01
7.2.80.0030.00716.93
7.2.70.0110.00416.89
7.2.60.0100.00517.02
7.2.50.0060.00617.00
7.2.40.0040.01116.96
7.2.30.0120.00416.89
7.2.20.0060.01116.91
7.2.10.0070.01016.73
7.2.00.0090.00718.05
7.1.250.0090.00615.82
7.1.200.0030.01015.75
7.1.100.0000.01118.36
7.1.70.0000.00817.30
7.1.60.0060.01819.82
7.1.50.0060.00616.68
7.1.00.0070.07322.54
7.0.200.0000.01016.68
7.0.140.0000.07022.19
7.0.60.0070.08720.09
7.0.50.0100.07717.89
7.0.40.0070.04020.16
7.0.30.0500.07320.21
7.0.20.0370.04720.09
7.0.10.0070.04320.23
7.0.00.0030.08720.14
5.6.280.0030.07321.04
5.6.210.0070.03720.57
5.6.200.0070.08018.18
5.6.190.0170.07720.50
5.6.180.3630.04020.48
5.6.170.0300.06020.44
5.6.160.0070.07720.39
5.6.150.0100.08318.21
5.6.140.0070.08018.16
5.6.130.0030.08018.15
5.6.120.0100.08321.11
5.6.110.0030.04021.13
5.6.100.0000.04321.05
5.6.90.0070.07321.01
5.6.80.0130.05020.42
5.6.70.4500.03720.36
5.5.350.0200.05720.38
5.5.340.0100.07718.05
5.5.330.0070.07720.25
5.5.320.0330.07720.36
5.5.310.0230.05320.35
5.5.300.0070.06718.04
5.5.290.0030.04718.04
5.5.280.0000.05320.81
5.5.270.0100.04320.80
5.5.260.0100.08320.67
5.5.250.0070.08320.73
5.5.240.0130.06020.08
5.4.450.0770.05019.39
5.4.440.0470.06719.72
5.4.430.0030.06319.43
5.4.420.0000.06319.63
5.4.410.0130.05019.27
5.4.400.1770.00018.89
5.4.390.1570.00018.63
5.4.380.0930.05018.57
5.4.370.0100.05718.74
5.4.360.0130.05318.49
5.4.350.0200.05318.75
5.4.340.0170.05018.77
5.4.320.0040.04012.52
5.4.310.0100.04512.52
5.4.300.0080.03612.52
5.4.290.0040.04112.52
5.4.280.0050.03712.41
5.4.270.0030.06318.98
5.4.260.0070.07718.66
5.4.250.0130.05019.09
5.4.240.0070.05718.74
5.4.230.0170.07018.94
5.4.220.0170.06318.97
5.4.210.0030.06718.96
5.4.200.0200.04318.76
5.4.190.0100.06318.73
5.4.180.0170.05018.73
5.4.170.0100.07018.79
5.4.160.0230.04018.80
5.4.150.0000.06318.88
5.4.140.0100.07316.50
5.4.130.0100.06316.39
5.4.120.0070.05016.41
5.4.110.0170.06716.52
5.4.100.0000.07316.44
5.4.90.0130.07016.44
5.4.80.0030.05716.42
5.4.70.0130.04716.44
5.4.60.0130.06016.52
5.4.50.0130.04316.60
5.4.40.0130.06716.54
5.4.30.0100.06716.59
5.4.20.0100.07016.48
5.4.10.0070.05316.53
5.4.00.0100.06715.77
5.3.290.0120.03812.80
5.3.280.0130.06714.79
5.3.270.0170.05014.46
5.3.260.0130.05714.46
5.3.250.0070.05314.53
5.3.240.0130.04714.61
5.3.230.0170.04314.68
5.3.220.0070.07314.57
5.3.210.0070.05314.60
5.3.200.0130.05714.61
5.3.190.0100.07014.67
5.3.180.0100.04714.49
5.3.170.0130.04714.69
5.3.160.0030.06314.76
5.3.150.0170.06714.66
5.3.140.0130.06314.55
5.3.130.0170.06314.66
5.3.120.0100.05714.57
5.3.110.0100.05314.39
5.3.100.0030.07314.02
5.3.90.0030.05314.01
5.3.80.0070.06014.05
5.3.70.0030.06014.21
5.3.60.0130.06314.24
5.3.50.0100.05014.19
5.3.40.0070.07714.05
5.3.30.0070.07314.02
5.3.20.0100.06313.80
5.3.10.0030.05713.74
5.3.00.0130.06313.63
5.2.170.0030.04310.99
5.2.160.0070.04711.32
5.2.150.0070.05311.02
5.2.140.0100.06311.15
5.2.130.0100.05711.11
5.2.120.0100.05311.10
5.2.110.0070.04711.30
5.2.100.0100.05311.20
5.2.90.0130.03711.34
5.2.80.0130.04011.33
5.2.70.0030.05311.10
5.2.60.0000.05011.15
5.2.50.0130.04011.00
5.2.40.0030.05711.02
5.2.30.0070.04311.07
5.2.20.0130.05011.16
5.2.10.0130.04710.96
5.2.00.0030.05010.91
5.1.60.0070.04710.22
5.1.50.0030.05310.06
5.1.40.0000.04010.10
5.1.30.0130.05010.34
5.1.20.0100.04010.34
5.1.10.0070.0439.93
5.1.00.0030.04010.13
5.0.50.0000.0378.64
5.0.40.0070.0278.46
5.0.30.0100.0508.30
5.0.20.0070.0378.19
5.0.10.0130.0278.29
5.0.00.0000.0608.43
4.4.90.0000.0336.02
4.4.80.0030.0306.02
4.4.70.0030.0306.02
4.4.60.0000.0236.02
4.4.50.0100.0176.02
4.4.40.0000.0406.02
4.4.30.0000.0276.02
4.4.20.0030.0276.02
4.4.10.0070.0206.02
4.4.00.0030.0406.02
4.3.110.0000.0336.02
4.3.100.0100.0136.02
4.3.90.0000.0236.02
4.3.80.0070.0276.02
4.3.70.0030.0376.02
4.3.60.0030.0306.02
4.3.50.0000.0276.02
4.3.40.0030.0306.02
4.3.30.0070.0276.02
4.3.20.0000.0236.02
4.3.10.0000.0306.02
4.3.00.0130.0236.59

preferences:
37.38 ms | 401 KiB | 5 Q