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, -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.70.0110.00718.80
8.3.60.0180.00418.46
8.3.50.0240.00721.96
8.3.40.0090.00918.96
8.3.30.0000.01419.07
8.3.20.0060.00320.05
8.3.10.0040.00422.15
8.3.00.0000.00822.14
8.2.190.0210.00016.88
8.2.180.0120.00616.75
8.2.170.0110.00422.96
8.2.160.0130.00322.13
8.2.150.0040.00424.18
8.2.140.0120.00324.66
8.2.130.0080.00026.16
8.2.120.0100.00019.61
8.2.110.0030.00622.08
8.2.100.0090.00319.63
8.2.90.0080.00019.22
8.2.80.0000.00817.97
8.2.70.0050.00317.63
8.2.60.0040.00418.05
8.2.50.0080.00018.07
8.2.40.0040.00418.34
8.2.30.0050.00218.25
8.2.20.0080.00017.79
8.2.10.0090.00019.47
8.2.00.0030.00617.86
8.1.280.0100.00725.92
8.1.270.0040.00422.07
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0040.00423.91
8.1.230.0040.00719.02
8.1.220.0000.00917.79
8.1.210.0050.00318.77
8.1.200.0060.00317.38
8.1.190.0050.00317.53
8.1.180.0030.00518.10
8.1.170.0070.00318.30
8.1.160.0080.00022.02
8.1.150.0040.00418.59
8.1.140.0040.00417.49
8.1.130.0000.00717.87
8.1.120.0000.00717.53
8.1.110.0050.00317.48
8.1.100.0040.00417.47
8.1.90.0020.00517.47
8.1.80.0040.00417.50
8.1.70.0070.00017.45
8.1.60.0090.00017.64
8.1.50.0030.00517.55
8.1.40.0000.00817.44
8.1.30.0040.00417.68
8.1.20.0000.00917.67
8.1.10.0040.00417.63
8.1.00.0000.00717.52
8.0.300.0070.00018.77
8.0.290.0000.00717.29
8.0.280.0000.00818.48
8.0.270.0040.00417.14
8.0.260.0000.00616.97
8.0.250.0070.00016.95
8.0.240.0080.00017.00
8.0.230.0070.00016.98
8.0.220.0050.00317.07
8.0.210.0000.00716.93
8.0.200.0000.00716.94
8.0.190.0000.00817.06
8.0.180.0080.00017.07
8.0.170.0000.00816.96
8.0.160.0040.00417.04
8.0.150.0040.00416.89
8.0.140.0070.00016.87
8.0.130.0030.00313.52
8.0.120.0030.00516.93
8.0.110.0040.00417.05
8.0.100.0030.00516.98
8.0.90.0000.00817.02
8.0.80.0150.00016.99
8.0.70.0040.00417.04
8.0.60.0000.00817.06
8.0.50.0030.00517.04
8.0.30.0090.00917.27
8.0.20.0110.00817.40
8.0.10.0040.00417.10
8.0.00.0110.00816.84
7.4.330.0080.00015.00
7.4.320.0060.00016.65
7.4.300.0030.00316.54
7.4.290.0030.00616.57
7.4.280.0040.00416.63
7.4.270.0030.00316.53
7.4.260.0080.00016.65
7.4.250.0080.00016.61
7.4.240.0060.00116.54
7.4.230.0070.00016.74
7.4.220.0110.00616.50
7.4.210.0120.00616.55
7.4.200.0050.00216.59
7.4.190.0040.00416.68
7.4.160.0120.00416.56
7.4.150.0160.00317.40
7.4.140.0100.00817.86
7.4.130.0140.00716.65
7.4.120.0080.00816.65
7.4.110.0160.00616.45
7.4.100.0060.01516.79
7.4.90.0110.00716.67
7.4.80.0110.00619.39
7.4.70.0150.00316.59
7.4.60.0110.00616.36
7.4.50.0030.00316.48
7.4.40.0030.01222.77
7.4.30.0100.00716.39
7.4.10.0030.01315.13
7.4.00.0050.00915.03
7.3.330.0030.00313.35
7.3.320.0000.00513.24
7.3.310.0000.00716.28
7.3.300.0030.00316.47
7.3.290.0100.01016.45
7.3.280.0140.00616.47
7.3.270.0110.00617.40
7.3.260.0130.00616.46
7.3.250.0140.00616.47
7.3.240.0080.00916.61
7.3.230.0110.01116.48
7.3.210.0090.00916.47
7.3.200.0090.00619.39
7.3.190.0160.00316.50
7.3.180.0090.00616.42
7.3.170.0150.00616.50
7.3.160.0090.00616.55
7.3.130.0090.00914.79
7.3.120.0070.01014.98
7.3.110.0100.01014.88
7.3.100.0080.00414.87
7.3.90.0030.00715.16
7.3.80.0030.01014.95
7.3.70.0090.00014.97
7.3.60.0060.00914.95
7.3.50.0070.00714.96
7.3.40.0030.00814.97
7.3.30.0040.01114.94
7.3.20.0090.00016.79
7.3.10.0030.00616.93
7.3.00.0040.00716.90
7.2.330.0090.00916.77
7.2.320.0180.00616.44
7.2.310.0030.01316.71
7.2.300.0080.00916.79
7.2.290.0070.01016.49
7.2.260.0090.01215.39
7.2.250.0060.01315.40
7.2.240.0000.01515.42
7.2.230.0060.00915.14
7.2.220.0120.00614.89
7.2.210.0030.01215.15
7.2.200.0060.00315.22
7.2.190.0090.00615.20
7.2.180.0040.01214.90
7.2.170.0080.00314.93
7.2.160.0140.00014.86
7.2.150.0000.01316.91
7.2.140.0070.01016.94
7.2.130.0000.01016.92
7.2.120.0090.00316.78
7.2.110.0070.00717.09
7.2.100.0000.00917.13
7.2.90.0000.01516.96
7.2.80.0030.00916.75
7.2.70.0000.01617.00
7.2.60.0060.00317.14
7.2.50.0000.00916.92
7.2.40.0030.01017.13
7.2.30.0070.00716.91
7.2.20.0030.01117.06
7.2.10.0090.00617.10
7.2.00.0070.00718.12
7.1.330.0030.01215.83
7.1.320.0030.01415.92
7.1.310.0000.01515.95
7.1.300.0030.01115.81
7.1.290.0070.00715.58
7.1.280.0060.00315.88
7.1.270.0000.01515.74
7.1.260.0030.00615.77
7.1.250.0000.01215.76
7.1.240.0060.00315.60
7.1.230.0110.00015.99
7.1.220.0000.00815.69
7.1.210.0030.01015.73
7.1.200.0100.00015.73
7.1.190.0070.00315.96
7.1.180.0000.01415.70
7.1.170.0030.00615.94
7.1.160.0050.00315.76
7.1.150.0040.01115.82
7.1.140.0040.01215.62
7.1.130.0090.00915.63
7.1.120.0030.01015.93
7.1.110.0070.00715.75
7.1.100.0020.00917.03
7.1.90.0070.00315.96
7.1.80.0070.01015.77
7.1.70.0020.01016.58
7.1.60.0030.01417.80
7.1.50.0070.01116.44
7.1.40.0040.01115.61
7.1.30.0030.00915.64
7.1.20.0070.01015.54
7.1.10.0070.00715.57
7.1.00.0000.04519.21
7.0.330.0000.01015.64
7.0.320.0040.00715.19
7.0.310.0070.00715.57
7.0.300.0040.01115.40
7.0.290.0120.00015.30
7.0.280.0040.00815.37
7.0.270.0110.00315.18
7.0.260.0030.00715.45
7.0.250.0030.00815.54
7.0.240.0000.01215.49
7.0.230.0100.01015.29
7.0.220.0090.00915.54
7.0.210.0100.00615.53
7.0.200.0060.00516.19
7.0.190.0070.00715.21
7.0.180.0040.01415.39
7.0.170.0000.01715.44
7.0.160.0060.00315.49
7.0.150.0060.00315.11
7.0.140.0030.04218.53
7.0.130.0030.01015.58
7.0.120.0000.01315.56
7.0.110.0030.00915.55
7.0.100.0000.00915.45
7.0.90.0030.00515.43
7.0.80.0070.00715.33
7.0.70.0030.05118.62
7.0.60.0080.04318.64
7.0.50.0030.04918.88
7.0.40.0050.03016.84
7.0.30.0060.04516.94
7.0.20.0060.04016.79
7.0.10.0050.03516.79
7.0.00.0100.03116.90
5.6.400.0140.00314.00
5.6.390.0040.01014.34
5.6.380.0070.00714.76
5.6.370.0030.01014.46
5.6.360.0030.01014.48
5.6.350.0060.00314.43
5.6.340.0040.00814.77
5.6.330.0030.01414.43
5.6.320.0030.00614.54
5.6.310.0100.00714.46
5.6.300.0060.00914.33
5.6.290.0000.01414.18
5.6.280.0070.00314.54
5.6.270.0040.00814.69
5.6.260.0070.00714.40
5.6.250.0060.00614.39
5.6.240.0030.00914.37
5.6.230.0100.00614.57
5.6.220.0140.03817.57
5.6.210.0030.05017.52
5.6.200.0070.04217.79
5.6.190.0120.03317.82
5.6.180.0110.04417.65
5.6.170.0080.04517.79
5.6.160.0050.04517.80
5.6.150.0050.03617.81
5.6.140.0050.05017.75
5.6.130.0090.03117.80
5.6.120.0050.02217.81
5.6.110.0070.04917.62
5.6.100.0070.04717.79
5.6.90.0030.05417.84
5.6.80.0080.04317.23
5.6.70.0080.04217.49
5.6.60.0070.04217.41
5.6.50.0030.05017.49
5.6.40.0110.04317.50
5.6.30.0090.04417.41
5.6.20.0110.03717.48
5.6.10.0030.04917.33
5.6.00.0020.04717.42
5.5.380.0090.00314.44
5.5.370.0000.01414.35
5.5.360.0050.03317.60
5.5.350.0120.04117.49
5.5.340.0110.03317.73
5.5.330.0030.04717.67
5.5.320.0050.04717.71
5.5.310.0100.04117.75
5.5.300.0030.04417.61
5.5.290.0030.03117.62
5.5.280.0050.03317.63
5.5.270.0050.04817.49
5.5.260.0080.04517.78
5.5.250.0050.03517.64
5.5.240.0060.05017.36
5.5.230.0050.02517.25
5.5.220.0050.04417.29
5.5.210.0050.04017.24
5.5.200.0050.02717.23
5.5.190.0050.04717.30
5.5.180.0030.04917.27
5.5.170.0130.00314.06
5.5.160.0040.03517.16
5.5.150.0080.03817.27
5.5.140.0120.04217.19
5.5.130.0070.04617.22
5.5.120.0100.03517.19
5.5.110.0000.05317.27
5.5.100.0080.03817.18
5.5.90.0070.02817.30
5.5.80.0050.04717.31
5.5.70.0090.03817.13
5.5.60.0100.04017.23
5.5.50.0060.03717.28
5.5.40.0110.04017.29
5.5.30.0110.03517.14
5.5.20.0030.03317.27
5.5.10.0120.03317.17
5.5.00.0080.04017.11
5.4.450.0050.03815.50
5.4.440.0080.02715.50
5.4.430.0100.02315.55
5.4.420.0070.04615.45
5.4.410.0100.04015.46
5.4.400.0080.04015.36
5.4.390.0030.02715.21
5.4.380.0100.03815.20
5.4.370.0070.03415.38
5.4.360.0030.03815.40
5.4.350.0070.04215.22
5.4.340.0080.04215.34
5.4.330.0050.00511.55
5.4.320.0020.03315.29
5.4.310.0050.04215.37
5.4.300.0060.04215.22
5.4.290.0050.03915.22
5.4.280.0050.03215.29
5.4.270.0080.03815.34
5.4.260.0040.03615.33
5.4.250.0050.04215.21
5.4.240.0110.03515.38
5.4.230.0070.04215.29
5.4.220.0110.03615.28
5.4.210.0020.04315.24
5.4.200.0060.03615.25
5.4.190.0030.04515.33
5.4.180.0110.03815.39
5.4.170.0030.04815.35
5.4.160.0070.04215.37
5.4.150.0090.03915.34
5.4.140.0050.04014.04
5.4.130.0080.03514.04
5.4.120.0030.02213.89
5.4.110.0060.02614.01
5.4.100.0030.02914.03
5.4.90.0050.02513.94
5.4.80.0050.03614.04
5.4.70.0080.04014.04
5.4.60.0040.03513.99
5.4.50.0050.03713.93
5.4.40.0070.03514.00
5.4.30.0020.04514.01
5.4.20.0070.02114.01
5.4.10.0020.03513.93
5.4.00.0060.04013.72
5.3.290.0070.02113.09
5.3.280.0020.04313.11
5.3.270.0060.04313.12
5.3.260.0050.03813.09
5.3.250.0050.04013.10
5.3.240.0030.02713.07
5.3.230.0030.03013.05
5.3.220.0050.03813.12
5.3.210.0070.03513.06
5.3.200.0050.04013.14
5.3.190.0080.04013.09
5.3.180.0060.04013.12
5.3.170.0070.03313.13
5.3.160.0100.03913.13
5.3.150.0050.04313.06
5.3.140.0080.04013.05
5.3.130.0050.03013.05
5.3.120.0020.02713.03
5.3.110.0110.02613.13
5.3.100.0040.03412.80
5.3.90.0060.02312.79
5.3.80.0050.03012.87
5.3.70.0120.04012.80
5.3.60.0030.02212.85
5.3.50.0030.04212.80
5.3.40.0030.04212.79
5.3.30.0080.03512.77
5.3.20.0090.02912.62
5.3.10.0080.02712.64
5.3.00.0050.04112.63
5.2.170.0000.03312.23
5.2.160.0030.05312.23
5.2.150.0100.05312.23
5.2.140.0030.05012.23
5.2.130.0100.04012.23
5.2.120.0070.03012.23
5.2.110.0100.05712.23
5.2.100.0100.05312.23
5.2.90.0100.06012.23
5.2.80.0070.06012.23
5.2.70.0100.06012.23
5.2.60.0030.04712.23
5.2.50.0070.06012.23
5.2.40.0000.05712.23
5.2.30.0000.05012.23
5.2.20.0070.06312.23
5.2.10.0100.05312.23
5.2.00.0030.06712.23
5.1.60.0030.05712.23
5.1.50.0030.05312.23
5.1.40.0030.05012.23
5.1.30.0000.05712.23
5.1.20.0030.04312.23
5.1.10.0130.05012.23
5.1.00.0100.04312.23
5.0.50.0070.04012.23
5.0.40.0030.04312.23
5.0.30.0070.07312.23
5.0.20.0030.04312.23
5.0.10.0030.03712.23
5.0.00.0070.06012.23
4.4.90.0000.04012.23
4.4.80.0070.03312.23
4.4.70.0030.03712.23
4.4.60.0030.02712.23
4.4.50.0000.03012.23
4.4.40.0030.04712.23
4.4.30.0130.02312.23
4.4.20.0030.03712.23
4.4.10.0030.01312.23
4.4.00.0000.05012.23
4.3.110.0100.02712.23
4.3.100.0100.02712.23
4.3.90.0000.03712.23
4.3.80.0030.05312.23
4.3.70.0070.02312.23
4.3.60.0030.03312.23
4.3.50.0000.03012.23
4.3.40.0030.04012.23
4.3.30.0030.02712.23
4.3.20.0030.02312.23
4.3.10.0000.02012.23
4.3.00.0000.01712.23

preferences:
37.25 ms | 401 KiB | 5 Q