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 { public $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->stores)); //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.40.0120.00918.84
8.3.30.0070.00719.09
8.3.20.0030.00620.19
8.3.10.0000.00821.96
8.3.00.0080.00022.42
8.2.170.0090.00622.96
8.2.160.0070.01022.15
8.2.150.0000.00724.18
8.2.140.0040.00424.66
8.2.130.0000.00726.16
8.2.120.0040.00419.36
8.2.110.0070.00322.00
8.2.100.0060.00619.76
8.2.90.0050.00319.11
8.2.80.0050.00317.97
8.2.70.0080.00017.74
8.2.60.0040.00417.92
8.2.50.0040.00418.07
8.2.40.0040.00418.34
8.2.30.0000.00818.10
8.2.20.0040.00417.87
8.2.10.0040.00419.50
8.2.00.0030.00617.72
8.1.270.0040.00421.91
8.1.260.0030.00526.35
8.1.250.0000.00728.09
8.1.240.0040.00423.59
8.1.230.0090.00319.08
8.1.220.0030.00517.78
8.1.210.0050.00318.77
8.1.200.0030.00717.36
8.1.190.0080.00017.64
8.1.180.0000.00918.10
8.1.170.0060.00318.59
8.1.160.0000.00721.96
8.1.150.0020.00518.68
8.1.140.0040.00417.53
8.1.130.0030.00617.86
8.1.120.0040.00417.39
8.1.110.0040.00417.49
8.1.100.0020.00517.46
8.1.90.0000.00717.46
8.1.80.0000.00717.46
8.1.70.0000.00717.45
8.1.60.0030.00617.61
8.1.50.0000.00817.54
8.1.40.0000.00817.51
8.1.30.0080.00017.68
8.1.20.0000.00817.63
8.1.10.0080.00017.51
8.1.00.0000.00817.57
8.0.300.0070.00018.77
8.0.290.0000.00717.29
8.0.280.0030.00518.53
8.0.270.0000.00717.34
8.0.260.0030.00316.83
8.0.250.0070.00017.02
8.0.240.0040.00417.04
8.0.230.0000.00716.91
8.0.220.0070.00017.01
8.0.210.0070.00016.99
8.0.200.0000.00617.05
8.0.190.0080.00017.08
8.0.180.0000.00717.06
8.0.170.0080.00017.07
8.0.160.0000.00716.91
8.0.150.0000.00816.99
8.0.140.0000.00816.86
8.0.130.0040.00413.41
8.0.120.0030.00516.87
8.0.110.0000.00816.91
8.0.100.0070.00017.04
8.0.90.0000.00816.89
8.0.80.0000.01616.88
8.0.70.0040.00417.06
8.0.60.0070.00016.96
8.0.50.0040.00416.95
8.0.30.0120.01217.24
8.0.20.0090.01017.40
8.0.10.0070.00017.00
8.0.00.0050.01516.91
7.4.330.0060.00015.09
7.4.320.0060.00016.41
7.4.300.0070.00016.56
7.4.290.0030.00716.45
7.4.280.0030.00316.48
7.4.270.0080.00016.63
7.4.260.0000.01016.43
7.4.250.0030.00516.54
7.4.240.0060.00116.67
7.4.230.0070.00016.75
7.4.220.0120.00616.72
7.4.210.0070.01216.65
7.4.200.0000.00716.52
7.4.190.0040.00416.77
7.4.160.0130.00316.60
7.4.150.0090.00917.40
7.4.140.0080.00917.86
7.4.130.0110.01016.56
7.4.120.0060.01116.56
7.4.110.0080.00816.59
7.4.100.0080.00816.52
7.4.90.0070.01116.54
7.4.80.0090.00919.39
7.4.70.0110.00716.53
7.4.60.0060.01016.50
7.4.50.0030.00616.36
7.4.40.0070.00722.77
7.4.30.0120.00616.70
7.4.10.0090.00915.00
7.4.00.0090.01015.06
7.3.330.0000.00513.46
7.3.320.0050.00013.46
7.3.310.0030.00516.29
7.3.300.0070.00016.47
7.3.290.0100.00716.48
7.3.280.0090.01016.43
7.3.270.0170.00017.40
7.3.260.0140.00416.41
7.3.250.0130.00516.55
7.3.240.0100.00716.48
7.3.230.0100.00716.65
7.3.210.0080.00816.64
7.3.200.0150.00319.39
7.3.190.0170.00716.75
7.3.180.0110.00416.59
7.3.170.0130.00316.48
7.3.160.0120.00416.57
7.3.130.0070.01015.06
7.3.120.0080.00814.88
7.3.110.0080.01014.76
7.3.100.0060.00914.94
7.3.90.0040.00814.92
7.3.80.0060.00914.99
7.3.70.0090.00614.92
7.3.60.0040.00914.89
7.3.50.0040.01015.01
7.3.40.0090.00614.87
7.3.30.0040.01114.92
7.3.20.0090.00416.75
7.3.10.0050.00816.53
7.3.00.0100.00316.77
7.2.330.0090.00916.83
7.2.320.0150.00916.80
7.2.310.0070.01016.54
7.2.300.0100.00716.89
7.2.290.0030.01316.85
7.2.260.0090.00915.31
7.2.250.0070.01115.22
7.2.240.0090.00815.02
7.2.230.0050.01015.11
7.2.220.0070.00515.20
7.2.210.0080.00615.10
7.2.200.0040.01015.08
7.2.190.0060.00915.18
7.2.180.0080.00915.08
7.2.170.0050.00915.15
7.2.160.0030.00914.83
7.2.150.0070.00716.74
7.2.140.0120.00016.73
7.2.130.0090.00616.93
7.2.120.0040.01116.89
7.2.110.0040.00916.97
7.2.100.0070.00716.94
7.2.90.0000.01016.77
7.2.80.0100.00616.98
7.2.70.0030.01016.97
7.2.60.0040.00816.74
7.2.50.0030.01316.96
7.2.40.0070.00717.00
7.2.30.0030.00617.04
7.2.20.0040.01116.95
7.2.10.0090.00916.70
7.2.00.0020.01318.13
7.1.330.0060.00915.84
7.1.320.0060.00615.84
7.1.310.0080.00715.69
7.1.300.0030.01015.67
7.1.290.0040.01015.78
7.1.280.0050.00615.71
7.1.270.0070.00515.78
7.1.260.0040.00915.76
7.1.250.0070.00315.69
7.1.240.0070.01015.71
7.1.230.0030.00916.00
7.1.220.0060.00315.73
7.1.210.0060.00615.63
7.1.200.0030.01215.78
7.1.190.0040.01115.83
7.1.180.0080.00415.92
7.1.170.0060.00315.77
7.1.160.0080.00815.51
7.1.150.0030.00615.80
7.1.140.0030.00615.78
7.1.130.0130.00615.80
7.1.120.0070.00715.48
7.1.110.0030.00615.90
7.1.100.0030.01116.97
7.1.90.0110.00315.78
7.1.80.0060.01015.81
7.1.70.0000.01116.39
7.1.60.0060.01317.71
7.1.50.0100.01016.29
7.1.40.0110.00415.80
7.1.30.0080.00415.90
7.1.20.0030.00715.75
7.1.10.0070.00715.83
7.1.00.0070.04019.10
7.0.330.0000.01115.30
7.0.320.0140.00015.22
7.0.310.0080.00415.48
7.0.300.0040.01115.43
7.0.290.0060.00615.44
7.0.280.0080.00315.57
7.0.270.0000.00815.46
7.0.260.0030.01015.50
7.0.250.0060.00715.66
7.0.240.0000.01515.40
7.0.230.0070.00715.52
7.0.220.0120.00015.38
7.0.210.0040.01115.40
7.0.200.0070.00916.11
7.0.190.0040.01215.44
7.0.180.0040.01115.45
7.0.170.0030.01015.61
7.0.160.0100.00015.30
7.0.150.0090.00315.29
7.0.140.0050.04018.80
7.0.130.0000.00915.20
7.0.120.0110.00315.49
7.0.110.0000.00815.58
7.0.100.0170.04717.62
7.0.90.0120.04817.70
7.0.80.0180.04617.75
7.0.70.0240.03517.69
7.0.60.0200.03717.76
7.0.50.0190.04517.89
7.0.40.0070.02616.80
7.0.30.0120.04016.84
7.0.20.0110.03916.73
7.0.10.0080.04316.82
7.0.00.0030.05116.80
5.6.400.0000.01514.41
5.6.390.0040.01114.27
5.6.380.0060.00914.72
5.6.370.0030.01014.12
5.6.360.0030.00614.81
5.6.350.0030.01214.28
5.6.340.0070.00714.39
5.6.330.0110.00414.30
5.6.320.0000.00814.63
5.6.310.0110.00414.52
5.6.300.0000.01114.52
5.6.290.0130.00014.39
5.6.280.0050.04217.72
5.6.270.0060.00614.86
5.6.260.0120.00314.18
5.6.250.0060.04217.50
5.6.240.0050.02217.69
5.6.230.0030.02717.53
5.6.220.0070.04017.49
5.6.210.0050.04917.55
5.6.200.0030.04717.71
5.6.190.0050.04317.75
5.6.180.0100.04517.66
5.6.170.0110.04317.83
5.6.160.0030.03217.84
5.6.150.0100.04117.77
5.6.140.0090.04017.67
5.6.130.0030.05017.72
5.6.120.0050.02717.68
5.6.110.0050.04817.71
5.6.100.0050.02717.86
5.6.90.0030.02717.79
5.6.80.0030.02517.49
5.6.70.0040.02517.51
5.6.60.0040.02417.41
5.6.50.0050.02317.44
5.6.40.0090.02217.38
5.6.30.0010.02417.35
5.6.20.0030.02717.32
5.6.10.0000.02617.29
5.6.00.0060.02317.50
5.5.380.0070.04417.48
5.5.370.0090.01717.51
5.5.360.0030.04217.39
5.5.350.0080.04117.38
5.5.340.0080.03017.59
5.5.330.0110.03517.51
5.5.320.0070.04617.67
5.5.310.0040.03117.81
5.5.300.0050.03017.54
5.5.290.0030.02917.51
5.5.280.0130.04017.70
5.5.270.0050.03117.67
5.5.260.0060.02617.70
5.5.250.0020.03117.52
5.5.240.0070.02717.36
5.5.230.0120.01817.13
5.5.220.0070.02017.29
5.5.210.0080.02017.19
5.5.200.0030.02617.28
5.5.190.0050.02017.39
5.5.180.0040.02617.29
5.5.170.0030.00914.18
5.5.160.0020.02317.20
5.5.150.0000.02717.25
5.5.140.0070.02517.26
5.5.130.0050.02217.23
5.5.120.0080.02017.18
5.5.110.0030.04017.25
5.5.100.0050.02317.27
5.5.90.0070.01817.31
5.5.80.0050.02517.14
5.5.70.0030.02217.20
5.5.60.0030.02317.08
5.5.50.0050.02217.16
5.5.40.0080.01517.18
5.5.30.0020.02417.21
5.5.20.0020.02717.25
5.5.10.0050.02217.12
5.5.00.0090.01517.17
5.4.450.0060.04015.60
5.4.440.0070.04515.60
5.4.430.0130.01515.60
5.4.420.0070.02515.59
5.4.410.0030.02515.53
5.4.400.0020.02515.38
5.4.390.0020.02515.43
5.4.380.0050.02015.49
5.4.370.0080.01815.46
5.4.360.0060.02115.48
5.4.350.0030.02015.51
5.4.340.0050.02215.48
5.4.330.0000.00711.84
5.4.320.0030.02315.46
5.4.310.0040.02315.37
5.4.300.0010.03615.44
5.4.290.0050.01815.44
5.4.280.0070.02015.37
5.4.270.0020.02515.39
5.4.260.0060.01815.44
5.4.250.0040.02315.50
5.4.240.0050.02515.37
5.4.230.0020.02115.53
5.4.220.0070.02215.44
5.4.210.0070.02215.43
5.4.200.0020.02515.36
5.4.190.0050.02015.44
5.4.180.0050.01915.43
5.4.170.0060.02015.47
5.4.160.0020.02315.47
5.4.150.0050.01715.44
5.4.140.0090.02214.08
5.4.130.0070.02014.13
5.4.120.0000.03414.12
5.4.110.0030.03514.16
5.4.100.0050.03914.18
5.4.90.0070.02214.16
5.4.80.0030.04014.19
5.4.70.0060.03714.18
5.4.60.0030.02714.15
5.4.50.0090.03014.12
5.4.40.0070.03814.20
5.4.30.0060.03114.16
5.4.20.0070.04214.21
5.4.10.0030.02414.12
5.4.00.0070.02113.79
5.3.290.0050.02113.77
5.3.280.0030.02113.77
5.3.270.0030.02113.77
5.3.260.0050.01813.77
5.3.250.0050.01813.77
5.3.240.0070.02013.77
5.3.230.0020.02313.77
5.3.220.0020.02513.77
5.3.210.0050.04013.77
5.3.200.0020.04413.77
5.3.190.0030.04413.77
5.3.180.0050.02513.77
5.3.170.0080.02613.77
5.3.160.0020.03613.77
5.3.150.0120.03313.77
5.3.140.0050.04013.77
5.3.130.0020.02613.77
5.3.120.0080.04013.77
5.3.110.0050.04213.77
5.3.100.0030.04013.77
5.3.90.0050.03013.77
5.3.80.0060.03813.77
5.3.70.0050.04213.77
5.3.60.0100.02113.77
5.3.50.0050.02513.77
5.3.40.0020.02513.77
5.3.30.0050.03713.77
5.3.20.0100.03313.77
5.3.10.0050.04013.77
5.3.00.0000.02713.77
5.2.170.0070.05715.70
5.2.160.0070.04315.70
5.2.150.0170.05715.70
5.2.140.0000.06015.70
5.2.130.0070.03315.70
5.2.120.0100.05315.70
5.2.110.0070.05715.70
5.2.100.0100.02715.70
5.2.90.0000.06015.70
5.2.80.0000.06315.70
5.2.70.0130.05315.70
5.2.60.0000.06715.70
5.2.50.0000.07015.70
5.2.40.0100.03315.70
5.2.30.0030.05715.70
5.2.20.0130.05315.70
5.2.10.0070.05715.70
5.2.00.0070.02715.70
5.1.60.0030.04715.70
5.1.50.0030.05315.70
5.1.40.0100.04715.70
5.1.30.0070.06015.70
5.1.20.0030.05715.70
5.1.10.0030.04715.70
5.1.00.0030.05315.70
5.0.50.0070.04315.70
5.0.40.0100.03715.70
5.0.30.0030.05015.70
5.0.20.0030.04015.70
5.0.10.0100.04015.70
5.0.00.0070.06315.70
4.4.90.0000.04015.70
4.4.80.0070.03015.70
4.4.70.0030.03715.70
4.4.60.0000.03015.70
4.4.50.0000.02315.70
4.4.40.0030.05315.70
4.4.30.0070.01715.70
4.4.20.0000.03315.70
4.4.10.0030.02015.70
4.4.00.0070.02715.70
4.3.110.0030.02015.70
4.3.100.0000.03715.70
4.3.90.0000.02715.70
4.3.80.0030.05015.70
4.3.70.0070.03015.70
4.3.60.0000.04015.70
4.3.50.0030.03315.70
4.3.40.0030.05015.70
4.3.30.0000.03015.70
4.3.20.0000.03715.70
4.3.10.0000.02015.70
4.3.00.0070.02715.70

preferences:
47.46 ms | 400 KiB | 5 Q