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 $store; 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 = explode("<br />", $items); foreach($items as $num => $val) { if($num % 2 === 0) { $out[$num] = $val; } else { $out[$num] = strtolower($val); } } return $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.0160.00618.81
8.3.60.0190.00318.30
8.3.50.0120.00721.98
8.3.40.0070.01018.86
8.3.30.0060.00818.91
8.3.20.0070.00320.21
8.3.10.0060.00321.97
8.3.00.0000.00922.52
8.2.180.0120.00917.00
8.2.170.0120.00322.96
8.2.160.0070.01022.13
8.2.150.0080.00024.18
8.2.140.0110.00824.66
8.2.130.0040.00426.16
8.2.120.0060.00319.36
8.2.110.0030.00722.29
8.2.100.0090.00319.76
8.2.90.0040.00419.21
8.2.80.0030.00518.05
8.2.70.0050.00317.75
8.2.60.0050.00318.05
8.2.50.0000.00818.07
8.2.40.0050.00318.16
8.2.30.0000.00718.09
8.2.20.0000.00817.67
8.2.10.0000.00819.59
8.2.00.0040.00717.69
8.1.280.0110.00325.92
8.1.270.0000.00722.04
8.1.260.0030.00526.35
8.1.250.0030.00628.09
8.1.240.0080.00023.84
8.1.230.0040.00719.04
8.1.220.0000.00817.74
8.1.210.0000.00918.77
8.1.200.0030.00617.36
8.1.190.0080.00017.53
8.1.180.0040.00418.10
8.1.170.0040.00418.59
8.1.160.0000.00721.97
8.1.150.0000.00718.69
8.1.140.0050.00217.41
8.1.130.0040.00417.75
8.1.120.0070.00017.50
8.1.110.0000.00717.52
8.1.100.0030.00517.50
8.1.90.0040.00417.42
8.1.80.0040.00417.55
8.1.70.0030.00317.47
8.1.60.0030.00617.54
8.1.50.0040.00417.52
8.1.40.0040.00417.46
8.1.30.0000.00817.69
8.1.20.0030.00517.66
8.1.10.0000.00917.63
8.1.00.0040.00417.53
8.0.300.0070.00018.77
8.0.290.0000.00817.16
8.0.280.0000.00718.41
8.0.270.0040.00417.30
8.0.260.0060.00016.84
8.0.250.0080.00017.05
8.0.240.0040.00417.03
8.0.230.0080.00017.09
8.0.220.0070.00016.87
8.0.210.0000.00716.98
8.0.200.0000.00716.93
8.0.190.0040.00416.99
8.0.180.0080.00017.05
8.0.170.0000.00817.03
8.0.160.0040.00417.06
8.0.150.0050.00317.05
8.0.140.0040.00416.98
8.0.130.0020.00613.46
8.0.120.0060.00317.04
8.0.110.0080.00016.91
8.0.100.0040.00416.86
8.0.90.0040.00417.06
8.0.80.0080.00816.99
8.0.70.0040.00416.90
8.0.60.0070.00016.87
8.0.50.0040.00416.96
8.0.30.0030.01617.27
8.0.20.0150.00817.40
8.0.10.0040.00417.05
8.0.00.0130.01116.86
7.4.330.0000.00615.07
7.4.320.0030.00316.70
7.4.300.0040.00416.45
7.4.290.0000.00916.64
7.4.280.0070.00016.59
7.4.270.0000.00716.63
7.4.260.0060.00516.58
7.4.250.0000.00716.62
7.4.240.0040.00416.55
7.4.230.0030.00316.39
7.4.220.0030.01416.70
7.4.210.0060.01016.63
7.4.200.0000.00716.45
7.4.190.0070.00016.68
7.4.160.0090.00616.43
7.4.150.0120.00617.40
7.4.140.0080.01017.86
7.4.130.0120.00716.62
7.4.120.0160.00516.47
7.4.110.0130.01016.49
7.4.100.0040.01416.52
7.4.90.0150.00616.54
7.4.80.0100.00719.39
7.4.70.0040.01216.57
7.4.60.0120.00916.56
7.4.50.0000.00416.44
7.4.40.0060.01222.77
7.4.30.0170.00016.36
7.4.00.0080.00914.88
7.3.330.0050.00013.37
7.3.320.0030.00313.39
7.3.310.0070.00016.50
7.3.300.0030.00316.32
7.3.290.0030.01816.42
7.3.280.0120.00716.38
7.3.270.0030.01317.40
7.3.260.0060.01116.41
7.3.250.0080.01116.49
7.3.240.0060.01016.36
7.3.230.0120.00816.55
7.3.210.0130.00316.71
7.3.200.0030.01419.39
7.3.190.0060.01016.55
7.3.180.0040.01216.65
7.3.170.0190.00316.35
7.3.160.0100.00716.47
7.3.120.0090.00914.79
7.3.110.0070.01015.09
7.3.100.0030.00915.16
7.3.90.0030.01415.07
7.3.80.0000.01514.63
7.3.70.0100.00614.92
7.3.60.0070.00715.00
7.3.50.0030.01015.04
7.3.40.0080.00414.87
7.3.30.0090.00014.91
7.3.20.0030.00816.66
7.3.10.0070.00716.67
7.3.00.0060.00516.66
7.2.330.0150.00316.51
7.2.320.0100.01416.73
7.2.310.0100.00616.92
7.2.300.0070.01016.84
7.2.290.0120.00416.77
7.2.250.0030.01414.98
7.2.240.0030.01715.36
7.2.230.0030.01315.01
7.2.220.0070.00715.41
7.2.210.0000.01115.17
7.2.200.0050.00515.22
7.2.190.0030.01015.28
7.2.180.0100.00715.19
7.2.170.0040.00815.19
7.2.130.0060.00916.95
7.2.120.0040.00717.00
7.2.110.0000.00917.12
7.2.100.0030.00717.09
7.2.90.0030.01017.15
7.2.80.0070.00416.78
7.2.70.0090.00316.85
7.2.60.0050.00517.02
7.2.50.0100.00316.80
7.2.40.0040.00717.09
7.2.30.0000.01216.93
7.2.20.0030.01016.82
7.2.10.0030.01017.02
7.2.00.0030.00818.06
7.1.330.0110.00415.57
7.1.320.0060.00916.07
7.1.310.0060.00915.93
7.1.300.0030.01315.86
7.1.290.0030.00915.69
7.1.280.0080.00416.03
7.1.270.0030.00615.75
7.1.260.0040.00815.73
7.1.250.0100.00015.62
7.1.200.0070.00715.84
7.1.100.0070.01017.83
7.1.70.0000.01016.96
7.1.60.0200.00319.82
7.1.50.0140.01116.94
7.1.00.0100.07022.33
7.0.200.0040.00416.81
7.0.140.0070.07022.13
7.0.100.0100.03721.77
7.0.90.0030.04021.70
7.0.80.0070.03321.68
7.0.70.0070.06021.70
7.0.60.0000.05721.73
7.0.50.0070.07022.12
7.0.40.0000.04320.13
7.0.30.0030.04320.11
7.0.20.0070.04320.08
7.0.10.0070.08320.09
7.0.00.0100.08320.14
5.6.280.0130.06720.90
5.6.250.0000.04320.51
5.6.240.0070.04320.74
5.6.230.0030.05720.54
5.6.220.0030.04320.66
5.6.210.0030.04020.63
5.6.200.0030.04321.20
5.6.190.0030.04321.02
5.6.180.0030.04321.07
5.6.170.0030.07020.95
5.6.160.0000.09721.09
5.6.150.0100.08021.18
5.6.140.0100.08321.09
5.6.130.0070.06720.96
5.6.120.0070.06021.09
5.6.110.0130.04020.95
5.6.100.0070.07720.95
5.6.90.0130.08021.02
5.6.80.0000.05020.45
5.6.70.0000.04720.32
5.6.60.0100.07320.35
5.6.50.0130.07320.45
5.6.40.0200.06320.39
5.6.30.0100.07720.33
5.6.20.0070.05020.30
5.6.10.0000.04320.53
5.6.00.0070.07720.36
5.5.380.0000.04020.45
5.5.370.0100.03320.43
5.5.360.0000.04720.40
5.5.350.0030.04020.46
5.5.340.0030.04020.89
5.5.330.0030.04020.78
5.5.320.0030.03720.88
5.5.310.0030.05020.87
5.5.300.0100.08020.92
5.5.290.0070.08720.88
5.5.280.0170.07720.93
5.5.270.0100.07020.78
5.5.260.0100.08320.78
5.5.250.0100.07020.63
5.5.240.0130.04720.20
5.5.230.0100.07720.16
5.5.220.0000.06020.15
5.5.210.0130.07720.28
5.5.200.0130.06020.27
5.5.190.0030.06720.23
5.5.180.0030.06320.13
5.5.160.0200.06320.00
5.5.150.0030.05020.27
5.5.140.0070.05720.25
5.5.130.0030.07720.23
5.5.120.0070.06020.12
5.5.110.0100.07020.16
5.5.100.0030.04720.12
5.5.90.0030.06320.08
5.5.80.0000.06720.18
5.5.70.0070.04320.07
5.5.60.0100.04020.15
5.5.50.0070.07719.97
5.5.40.0330.06019.97
5.5.30.0170.05020.15
5.5.20.0130.06320.05
5.5.10.0100.08020.13
5.5.00.0130.04020.05
5.4.450.0030.04719.36
5.4.440.0030.08719.46
5.4.430.0100.07019.48
5.4.420.0070.08319.34
5.4.410.0170.06719.24
5.4.400.0100.07019.13
5.4.390.0070.06318.88
5.4.380.0070.06719.09
5.4.370.0070.08019.18
5.4.360.0070.06319.18
5.4.350.0130.06719.21
5.4.340.0170.05318.85
5.4.320.0000.08018.95
5.4.310.0200.05719.18
5.4.300.0130.07719.00
5.4.290.0200.05718.94
5.4.280.0030.07719.18
5.4.270.0100.06319.23
5.4.260.0070.04018.90
5.4.250.0100.05019.17
5.4.240.0130.06319.02
5.4.230.0130.05319.04
5.4.220.0100.06719.17
5.4.210.0030.04719.12
5.4.200.0070.07318.98
5.4.190.0270.05719.19
5.4.180.0070.07318.89
5.4.170.0000.08018.93
5.4.160.0130.04719.14
5.4.150.0070.07019.21
5.4.140.0100.07716.49
5.4.130.0070.07716.48
5.4.120.0030.07316.24
5.4.110.0070.07316.39
5.4.100.0030.07716.39
5.4.90.0030.05316.44
5.4.80.0100.06716.43
5.4.70.0100.07316.52
5.4.60.0100.07716.32
5.4.50.0030.07716.44
5.4.40.0070.07316.50
5.4.30.0130.06716.44
5.4.20.0070.07316.45
5.4.10.0200.06316.41
5.4.00.0130.06715.81
5.3.290.0100.06314.63
5.3.280.0070.08014.65
5.3.270.0070.05714.73
5.3.260.0100.07014.64
5.3.250.0070.07314.59
5.3.240.0070.04714.72
5.3.230.0170.07014.59
5.3.220.0000.08314.70
5.3.210.0100.04014.66
5.3.200.0100.04014.53
5.3.190.0100.04314.66
5.3.180.0070.06714.53
5.3.170.0070.07014.59
5.3.160.0070.07714.57
5.3.150.0030.07714.57
5.3.140.0000.08314.61
5.3.130.0030.08014.55
5.3.120.0070.08014.58
5.3.110.0030.08714.56
5.3.100.0030.06014.11
5.3.90.0000.06314.02
5.3.80.0030.05713.97
5.3.70.0070.07014.10
5.3.60.0100.07013.93
5.3.50.0070.04714.00
5.3.40.0130.06313.88
5.3.30.0030.04314.06
5.3.20.0100.06313.78
5.3.10.0030.07313.67
5.3.00.0030.07313.73
5.2.170.0070.06311.29
5.2.160.0030.06011.19
5.2.150.0000.04711.07
5.2.140.0030.03311.07
5.2.130.0100.06011.02
5.2.120.0130.05011.04
5.2.110.0070.03311.15
5.2.100.0030.06711.18
5.2.90.0070.06311.12
5.2.80.0100.06011.17
5.2.70.0200.05011.18
5.2.60.0030.06311.14
5.2.50.0100.05711.14
5.2.40.0030.06011.16
5.2.30.0100.05310.86
5.2.20.0100.06010.90
5.2.10.0070.05310.95
5.2.00.0030.04710.75
5.1.60.0030.05310.14
5.1.50.0070.0509.96
5.1.40.0100.03010.12
5.1.30.0170.04010.38
5.1.20.0100.05310.45
5.1.10.0070.05310.14
5.1.00.0030.04710.22
5.0.50.0070.0309.96
5.0.40.0130.0339.96
5.0.30.0070.0479.96
5.0.20.0000.0409.96
5.0.10.0030.0409.96
5.0.00.0100.0579.96
4.4.90.0070.0279.96
4.4.80.0000.0409.96
4.4.70.0000.0339.96
4.4.60.0000.0279.96
4.4.50.0100.0279.96
4.4.40.0000.0539.96
4.4.30.0100.0279.96
4.4.20.0070.0339.96
4.4.10.0030.0339.96
4.4.00.0130.0179.96
4.3.110.0030.0379.96
4.3.100.0070.0309.96
4.3.90.0100.0309.96
4.3.80.0000.0409.96
4.3.70.0070.0339.96
4.3.60.0000.0339.96
4.3.50.0100.0279.96
4.3.40.0070.0479.96
4.3.30.0070.0339.96
4.3.20.0000.0379.96
4.3.10.0000.0279.96
4.3.00.0000.0309.96

preferences:
46.21 ms | 401 KiB | 5 Q