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, $out ) { 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.0170.00318.30
8.3.50.0110.01121.99
8.3.40.0140.00319.00
8.3.30.0100.01019.27
8.3.20.0000.00820.38
8.3.10.0040.00422.14
8.3.00.0000.00822.34
8.2.180.0100.00716.75
8.2.170.0040.01422.96
8.2.160.0070.00722.21
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0090.00026.16
8.2.120.0130.00319.83
8.2.110.0120.00319.35
8.2.100.0110.00017.78
8.2.90.0030.00619.25
8.2.80.0040.00417.97
8.2.70.0000.00817.63
8.2.60.0040.00417.91
8.2.50.0000.00818.07
8.2.40.0000.00818.09
8.2.30.0040.00417.93
8.2.20.0000.00817.67
8.2.10.0000.00819.46
8.2.00.0090.00017.70
8.1.280.0100.00725.92
8.1.270.0000.00821.96
8.1.260.0060.00326.35
8.1.250.0040.00428.09
8.1.240.0140.00722.06
8.1.230.0040.00819.00
8.1.220.0030.00617.74
8.1.210.0040.00418.77
8.1.200.0000.00917.35
8.1.190.0030.00617.39
8.1.180.0060.00318.10
8.1.170.0030.00618.52
8.1.160.0050.00221.99
8.1.150.0000.00718.59
8.1.140.0000.00717.32
8.1.130.0000.00717.77
8.1.120.0000.00717.34
8.1.110.0040.00417.33
8.1.100.0040.00417.36
8.1.90.0040.00417.43
8.1.80.0040.00417.42
8.1.70.0000.00717.34
8.1.60.0060.00317.59
8.1.50.0040.00417.55
8.1.40.0000.00817.49
8.1.30.0030.00617.68
8.1.20.0080.00017.59
8.1.10.0040.00417.52
8.1.00.0040.00417.50
8.0.300.0000.00718.77
8.0.290.0000.00816.63
8.0.280.0030.00318.44
8.0.270.0080.00017.11
8.0.260.0030.00316.78
8.0.250.0030.00316.87
8.0.240.0070.00016.91
8.0.230.0030.00317.00
8.0.220.0030.00316.96
8.0.210.0000.00716.80
8.0.200.0050.00217.00
8.0.190.0000.00917.01
8.0.180.0000.00716.85
8.0.170.0040.00416.92
8.0.160.0040.00416.79
8.0.150.0040.00416.75
8.0.140.0040.00416.81
8.0.130.0050.00313.28
8.0.120.0000.00816.87
8.0.110.0000.00716.75
8.0.100.0000.00916.80
8.0.90.0040.00416.88
8.0.80.0060.01316.97
8.0.70.0000.00816.95
8.0.60.0070.00016.78
8.0.50.0030.00516.96
8.0.30.0110.00817.10
8.0.20.0080.01117.43
8.0.10.0030.00516.88
8.0.00.0120.00916.81
7.4.330.0030.00315.00
7.4.320.0060.00016.48
7.4.300.0100.00016.54
7.4.290.0030.00716.52
7.4.280.0040.00416.61
7.4.270.0000.00716.66
7.4.260.0100.00016.63
7.4.250.0030.00516.48
7.4.240.0000.00716.57
7.4.230.0040.00416.52
7.4.220.0140.00316.57
7.4.210.0100.00616.59
7.4.200.0040.00416.72
7.4.190.0070.00016.73
7.4.160.0130.00316.42
7.4.150.0120.00617.40
7.4.140.0110.00817.86
7.4.130.0110.00916.59
7.4.120.0060.01116.45
7.4.110.0100.00616.33
7.4.100.0000.01916.37
7.4.90.0110.01116.51
7.4.80.0090.00919.39
7.4.70.0060.01016.39
7.4.60.0040.01316.48
7.4.50.0020.00216.30
7.4.40.0050.00522.77
7.4.30.0060.01016.62
7.4.00.0060.00915.14
7.3.330.0000.00513.34
7.3.320.0030.00313.38
7.3.310.0080.00016.41
7.3.300.0030.00316.25
7.3.290.0000.01516.45
7.3.280.0100.00616.37
7.3.270.0100.01017.40
7.3.260.0160.00816.47
7.3.250.0110.00616.42
7.3.240.0100.00716.30
7.3.230.0110.00516.39
7.3.210.0120.00416.33
7.3.200.0120.00319.39
7.3.190.0200.00016.43
7.3.180.0070.01316.36
7.3.170.0060.00916.33
7.3.160.0120.00316.30
7.3.120.0030.01014.78
7.2.330.0100.00916.57
7.2.320.0090.00916.70
7.2.310.0070.01016.41
7.2.300.0100.00716.38
7.2.290.0080.00816.64
7.2.60.0040.00816.92
7.2.00.0120.00019.16
7.1.200.0150.00615.33
7.1.70.0000.01216.95
7.1.60.0030.01017.16
7.1.50.0250.01034.43
7.1.00.0000.07722.36
7.0.200.0060.00916.86
7.0.140.0070.07022.12
7.0.60.0030.04020.03
7.0.50.0000.06017.84
7.0.40.0100.03719.96
7.0.30.0200.05020.13
7.0.20.0230.09020.08
7.0.10.0230.05320.07
7.0.00.0030.09020.14
5.6.280.0030.07321.08
5.6.210.0130.06720.62
5.6.200.0100.04018.19
5.6.190.0030.08320.47
5.6.180.3430.04320.33
5.6.170.0300.04720.58
5.6.160.0100.07320.48
5.6.150.0130.07318.15
5.6.140.0130.07718.25
5.6.130.0070.08718.18
5.6.120.0070.05321.03
5.6.110.0100.05721.03
5.6.100.0030.06320.98
5.6.90.0100.08320.94
5.6.80.0100.07720.52
5.5.350.0000.07020.55
5.5.340.0030.06317.98
5.5.330.0130.08020.35
5.5.320.0230.05320.25
5.5.310.0300.07020.34
5.5.300.0070.08017.97
5.5.290.0070.08717.94
5.5.280.0070.04020.91
5.5.270.0000.04320.69
5.5.260.0030.04320.65
5.5.250.0130.06720.62
5.5.240.0030.05320.29
5.4.450.0200.05319.12
5.4.440.0330.04719.38
5.4.430.0100.05319.51
5.4.420.0100.05319.21
5.4.410.0130.06019.36
5.4.400.0970.00018.57
5.4.390.0630.00018.75
5.4.380.0300.05018.59
5.4.370.0100.05718.52
5.4.360.0130.05318.49
5.4.350.0270.04318.61
5.4.340.0100.05718.63
5.4.320.0080.03912.52
5.4.310.0080.03612.52
5.4.300.0090.03512.52
5.4.290.0080.04412.52
5.4.280.0040.04112.41
5.4.270.0030.06719.09
5.4.260.0100.06018.83
5.4.250.0130.06318.97
5.4.240.0130.06719.01
5.4.230.0130.05018.89
5.4.220.0130.05018.79
5.4.210.0200.06718.79
5.4.200.0170.04719.00
5.4.190.0100.07718.79
5.4.180.0100.05018.79
5.4.170.0100.05718.96
5.4.160.0200.04018.73
5.4.150.0170.05318.98
5.4.140.0230.05016.41
5.4.130.0170.07016.64
5.4.120.0100.07716.36
5.4.110.0100.05316.44
5.4.100.0030.05716.62
5.4.90.0170.04316.52
5.4.80.0130.04316.52
5.4.70.0100.05716.52
5.4.60.0100.06716.42
5.4.50.0130.06716.55
5.4.40.0070.07016.49
5.4.30.0130.06316.62
5.4.20.0100.06716.36
5.4.10.0100.06716.48
5.4.00.0130.04315.78
5.3.290.0060.04112.80
5.3.280.0000.06014.68
5.3.270.0130.06314.61
5.3.260.0100.05314.64
5.3.250.0170.07314.63
5.3.240.0070.07014.64
5.3.230.0030.07314.45
5.3.220.0170.05314.49
5.3.210.0100.07314.50
5.3.200.0100.05014.68
5.3.190.0130.06314.64
5.3.180.0130.07314.49
5.3.170.0000.06014.66
5.3.160.0100.07314.67
5.3.150.0030.08014.49
5.3.140.0200.04314.48
5.3.130.0070.06014.56
5.3.120.0130.06314.54
5.3.110.0100.07014.40
5.3.100.0170.04714.19
5.3.90.0100.06714.01
5.3.80.0070.05314.01
5.3.70.0070.05314.20
5.3.60.0030.05314.09
5.3.50.0070.06313.80
5.3.40.0270.05014.05
5.3.30.0170.06314.02
5.3.20.0070.06013.89
5.3.10.0130.06313.67
5.3.00.0030.06013.74
5.2.170.0070.05311.07
5.2.160.0100.05311.16
5.2.150.0130.04711.16
5.2.140.0030.06011.23
5.2.130.0030.04311.08
5.2.120.0070.05311.21
5.2.110.0100.05011.03
5.2.100.0070.04011.09
5.2.90.0070.04011.20
5.2.80.0100.04311.20
5.2.70.0070.05311.10
5.2.60.0070.04011.14
5.2.50.0030.04311.03
5.2.40.0070.04311.10
5.2.30.0130.04711.08
5.2.20.0070.03711.16
5.2.10.0030.05710.95
5.2.00.0070.04010.65
5.1.60.0100.04010.00
5.1.50.0030.04010.22
5.1.40.0100.03010.20
5.1.30.0070.03710.19
5.1.20.0130.03310.48
5.1.10.0030.04010.14
5.1.00.0000.04010.16
5.0.50.0130.0238.57
5.0.40.0070.0378.36
5.0.30.0100.0508.25
5.0.20.0100.0308.29
5.0.10.0070.0308.27
5.0.00.0100.0478.25
4.4.90.0070.0275.97
4.4.80.0000.0275.97
4.4.70.0070.0175.97
4.4.60.0000.0335.97
4.4.50.0170.0175.97
4.4.40.0100.0435.97
4.4.30.0070.0305.97
4.4.20.0000.0235.97
4.4.10.0100.0205.97
4.4.00.0030.0375.97
4.3.110.0100.0235.97
4.3.100.0030.0305.97
4.3.90.0000.0235.97
4.3.80.0000.0405.97
4.3.70.0070.0205.97
4.3.60.0000.0275.97
4.3.50.0030.0205.97
4.3.40.0070.0305.97
4.3.30.0030.0305.97
4.3.20.0070.0305.97
4.3.10.0000.0305.97
4.3.00.0000.0236.59

preferences:
44.33 ms | 401 KiB | 5 Q