3v4l.org

run code in 300+ PHP versions simultaneously
<?php class testCase { private $stores; /* $out not having default value so type not inferred */ /* names very vague */ public function doFunction($items = array(), $out ) { foreach($items as $num => $val) { /* lots of overriding of output here, seems like += or concat */ 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 ANYWAY? */ //$out = "<br />"; } return $this->store = $out; } /* PRIVATE, SO NOT ACCESSIBLE! FIX: make public */ /* name is vague */ 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 = array(), $out = '') { foreach($items as $num => $val) { if($num % 2 === 0) { $out .= $val; } else { $out .= strtoupper($val); } $out .= "<br />"; } return $this->store = $out; } public function unFunction($items = '', $out = array()) { $items = implode("<br />", $items); 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.0150.00618.55
8.3.50.0110.01121.90
8.3.40.0090.00618.79
8.3.30.0040.01119.09
8.3.20.0000.00820.21
8.3.10.0040.00421.96
8.3.00.0080.00022.38
8.2.180.0040.01117.00
8.2.170.0140.00322.96
8.2.160.0030.01022.13
8.2.150.0080.00024.18
8.2.140.0040.01124.66
8.2.130.0000.00726.16
8.2.120.0030.00719.36
8.2.110.0060.00322.12
8.2.100.0090.00319.64
8.2.90.0000.00819.21
8.2.80.0050.00317.97
8.2.70.0050.00517.75
8.2.60.0030.00618.16
8.2.50.0030.00518.07
8.2.40.0000.00818.34
8.2.30.0050.00318.21
8.2.20.0040.00417.88
8.2.10.0000.00819.55
8.2.00.0060.00317.82
8.1.280.0070.01425.92
8.1.270.0080.00022.10
8.1.260.0070.00026.35
8.1.250.0040.00428.09
8.1.240.0060.00323.85
8.1.230.0120.00019.15
8.1.220.0060.00317.74
8.1.210.0050.00318.77
8.1.200.0000.01017.22
8.1.190.0080.00017.53
8.1.180.0080.00018.10
8.1.170.0090.00018.53
8.1.160.0030.00321.98
8.1.150.0040.00418.68
8.1.140.0080.00017.50
8.1.130.0000.00717.98
8.1.120.0050.00317.49
8.1.110.0040.00417.50
8.1.100.0040.00417.50
8.1.90.0000.00717.36
8.1.80.0000.00717.55
8.1.70.0070.00017.53
8.1.60.0040.00417.56
8.1.50.0000.00917.53
8.1.40.0000.00817.63
8.1.30.0000.00717.60
8.1.20.0040.00417.63
8.1.10.0000.00817.58
8.1.00.0030.00617.48
8.0.300.0000.00818.77
8.0.290.0030.00617.30
8.0.280.0030.00318.48
8.0.270.0050.00317.18
8.0.260.0070.00016.85
8.0.250.0040.00416.96
8.0.240.0040.00416.97
8.0.230.0030.00317.11
8.0.220.0070.00016.94
8.0.210.0000.00716.96
8.0.200.0000.00716.93
8.0.190.0050.00317.05
8.0.180.0070.00017.09
8.0.170.0040.00417.07
8.0.160.0000.00716.99
8.0.150.0070.00016.92
8.0.140.0000.00716.88
8.0.130.0000.00613.40
8.0.120.0050.00216.95
8.0.110.0000.00716.89
8.0.100.0050.00216.83
8.0.90.0040.00416.88
8.0.80.0100.00716.98
8.0.70.0000.00816.84
8.0.60.0070.00016.87
8.0.50.0000.00817.04
8.0.30.0050.01317.26
8.0.20.0070.01217.40
8.0.10.0040.00417.13
8.0.00.0120.01016.71
7.4.330.0000.00615.00
7.4.320.0060.00016.66
7.4.300.0030.00316.63
7.4.290.0040.00416.55
7.4.280.0040.00416.55
7.4.270.0000.00716.66
7.4.260.0030.00716.57
7.4.250.0050.00216.58
7.4.240.0000.00716.55
7.4.230.0000.00716.63
7.4.220.0100.00716.50
7.4.210.0060.00916.67
7.4.200.0030.00516.57
7.4.190.0040.00416.73
7.4.160.0050.01016.65
7.4.150.0100.01417.40
7.4.140.0040.01317.86
7.4.130.0130.00716.65
7.4.120.0080.01016.53
7.4.110.0000.01616.51
7.4.100.0130.01016.61
7.4.90.0080.01116.64
7.4.80.0110.00919.39
7.4.70.0040.01216.47
7.4.60.0090.01216.49
7.4.50.0040.00416.35
7.4.40.0000.01722.77
7.4.30.0100.00616.69
7.4.00.0060.00915.15
7.3.330.0050.00013.49
7.3.320.0000.00513.22
7.3.310.0070.00016.37
7.3.300.0000.00716.33
7.3.290.0110.01016.54
7.3.280.0080.01116.45
7.3.270.0030.01417.40
7.3.260.0060.01216.47
7.3.250.0110.00916.47
7.3.240.0100.00716.57
7.3.230.0120.00616.54
7.3.210.0160.00216.54
7.3.200.0060.01219.39
7.3.190.0100.01016.67
7.3.180.0130.00316.60
7.3.170.0070.01016.52
7.3.160.0120.00316.48
7.3.120.0090.00614.98
7.2.330.0040.01416.69
7.2.320.0070.01716.65
7.2.310.0160.00716.69
7.2.300.0140.00316.59
7.2.290.0090.01216.55
7.2.60.0070.00717.03
7.2.00.0000.01019.48
7.1.200.0030.00515.79
7.1.100.0040.01417.92
7.1.70.0040.00417.30
7.1.60.0100.01419.82
7.1.50.0090.00616.68
7.1.00.0100.09022.45
7.0.200.0060.00316.79
7.0.140.0030.07022.15
7.0.60.0100.08320.00
7.0.50.0130.06717.91
7.0.40.0130.04720.27
7.0.30.0430.06020.25
7.0.20.0070.05020.24
7.0.10.0200.05720.26
7.0.00.0130.07720.23
5.6.280.0030.07320.91
5.6.210.0030.06020.77
5.6.200.0100.05318.29
5.6.190.0100.08020.63
5.6.180.4130.04320.63
5.6.170.0230.04320.47
5.6.160.0100.05020.54
5.6.150.0030.04018.18
5.6.140.0130.04318.19
5.6.130.0070.08018.18
5.6.120.0100.08721.00
5.6.110.0170.08020.99
5.6.100.0030.05321.14
5.6.90.0200.07721.11
5.6.80.0170.07020.38
5.6.70.0370.04320.42
5.5.350.0070.07720.37
5.5.340.0030.04017.96
5.5.330.0130.04020.21
5.5.320.0270.03720.51
5.5.310.0300.04020.24
5.5.300.0100.04017.95
5.5.290.0070.05717.97
5.5.280.0130.07320.82
5.5.270.0000.05020.88
5.5.260.0030.04720.90
5.5.250.0070.08320.73
5.5.240.0000.05320.17
5.4.450.0070.06019.55
5.4.440.0500.07319.47
5.4.430.0100.05719.36
5.4.420.0100.05319.52
5.4.410.0070.05719.44
5.4.400.1630.00018.85
5.4.390.1600.00018.71
5.4.380.0230.05318.79
5.4.370.0130.05318.55
5.4.360.0130.05318.71
5.4.350.0100.05718.71
5.4.340.0130.05718.77
5.4.320.0070.03512.52
5.4.310.0060.04012.52
5.4.300.0070.03612.52
5.4.290.0030.03912.52
5.4.280.0040.05012.42
5.4.270.0070.06318.79
5.4.260.0070.07718.89
5.4.250.0070.05318.95
5.4.240.0070.05718.65
5.4.230.0170.05018.93
5.4.220.0230.05718.90
5.4.210.0100.05318.76
5.4.200.0070.06318.98
5.4.190.0130.05718.99
5.4.180.0030.06018.93
5.4.170.0070.06018.93
5.4.160.0230.04718.94
5.4.150.0130.05718.95
5.4.140.0030.07316.41
5.4.130.0070.05716.51
5.4.120.0170.06316.41
5.4.110.0130.07016.57
5.4.100.0130.05316.62
5.4.90.0130.06316.43
5.4.80.0100.07016.52
5.4.70.0200.06716.36
5.4.60.0170.04716.63
5.4.50.0100.07316.59
5.4.40.0270.04316.41
5.4.30.0170.06316.40
5.4.20.0200.07016.36
5.4.10.0100.07316.59
5.4.00.0030.05316.03
5.3.290.0040.04112.80
5.3.280.0100.06014.45
5.3.270.0200.06714.71
5.3.260.0100.06014.87
5.3.250.0130.05014.46
5.3.240.0070.07714.61
5.3.230.0100.05314.63
5.3.220.0200.05314.56
5.3.210.0170.05714.67
5.3.200.0100.05314.77
5.3.190.0000.06014.68
5.3.180.0070.05314.80
5.3.170.0070.04714.77
5.3.160.0230.04014.42
5.3.150.0100.07314.68
5.3.140.0030.06014.76
5.3.130.0000.06314.58
5.3.120.0100.07714.64
5.3.110.0000.08014.59
5.3.100.0000.06014.22
5.3.90.0030.08014.05
5.3.80.0130.04714.06
5.3.70.0170.05014.04
5.3.60.0100.05014.11
5.3.50.0070.05713.80
5.3.40.0100.06313.96
5.3.30.0170.04714.03
5.3.20.0030.06713.89
5.3.10.0030.08013.52
5.3.00.0070.07013.82
5.2.170.0070.05311.23
5.2.160.0070.05011.16
5.2.150.0100.04711.25
5.2.140.0070.05011.39
5.2.130.0070.05311.19
5.2.120.0130.04711.20
5.2.110.0000.04711.08
5.2.100.0100.04711.34
5.2.90.0100.04011.21
5.2.80.0030.04011.10
5.2.70.0170.04311.19
5.2.60.0130.03711.14
5.2.50.0100.05711.05
5.2.40.0070.04311.20
5.2.30.0030.05011.10
5.2.20.0030.05011.00
5.2.10.0100.03311.05
5.2.00.0070.05310.75
5.1.60.0070.04010.22
5.1.50.0100.0379.98
5.1.40.0030.03710.01
5.1.30.0030.04010.36
5.1.20.0070.03710.35
5.1.10.0130.03010.25
5.1.00.0000.04310.25
5.0.50.0100.0338.58
5.0.40.0030.0378.36
5.0.30.0070.0408.25
5.0.20.0070.0238.29
5.0.10.0070.0278.36
5.0.00.0030.0538.19
4.4.90.0030.0305.84
4.4.80.0000.0235.84
4.4.70.0100.0135.84
4.4.60.0100.0175.84
4.4.50.0000.0335.84
4.4.40.0030.0335.86
4.4.30.0000.0275.91
4.4.20.0030.0305.89
4.4.10.0100.0275.89
4.4.00.0030.0436.02
4.3.110.0030.0305.84
4.3.100.0130.0105.84
4.3.90.0170.0205.84
4.3.80.0130.0235.84
4.3.70.0070.0205.87
4.3.60.0070.0275.84
4.3.50.0030.0235.84
4.3.40.0070.0405.84
4.3.30.0030.0235.84
4.3.20.0000.0275.84
4.3.10.0100.0235.84
4.3.00.0130.0206.53

preferences:
41.22 ms | 401 KiB | 5 Q