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 = array(), $out = '') { foreach($items as $num => $val) { if($num % 2 == 0) { $out += (string)$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.70.0160.00318.56
8.3.60.0000.01918.30
8.3.50.0170.00722.09
8.3.40.0120.00319.02
8.3.30.0030.01218.85
8.3.20.0070.00320.10
8.3.10.0040.00422.09
8.3.00.0040.00422.25
8.2.180.0110.00717.00
8.2.170.0070.01422.96
8.2.160.0030.01022.11
8.2.150.0060.00324.18
8.2.140.0000.00924.66
8.2.130.0000.00726.16
8.2.120.0100.00017.50
8.2.110.0060.00322.00
8.2.100.0030.00919.64
8.2.90.0080.00019.22
8.2.80.0050.00318.05
8.2.70.0000.00817.75
8.2.60.0000.00818.16
8.2.50.0050.00318.07
8.2.40.0050.00218.34
8.2.30.0000.00718.02
8.2.20.0080.00017.68
8.2.10.0040.00419.64
8.2.00.0090.00017.77
8.1.280.0080.00825.92
8.1.270.0030.00521.89
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0090.00023.74
8.1.230.0070.00419.16
8.1.220.0030.00617.79
8.1.210.0060.00318.77
8.1.200.0100.00017.35
8.1.190.0000.00817.53
8.1.180.0050.00318.10
8.1.170.0030.00718.64
8.1.160.0060.00321.96
8.1.150.0000.00818.64
8.1.140.0000.00717.35
8.1.130.0080.00017.92
8.1.120.0040.00417.54
8.1.110.0000.00717.46
8.1.100.0000.00717.46
8.1.90.0040.00417.34
8.1.80.0000.00717.51
8.1.70.0030.00317.46
8.1.60.0060.00317.58
8.1.50.0050.00317.59
8.1.40.0000.00717.55
8.1.30.0000.00717.70
8.1.20.0030.00617.57
8.1.10.0080.00017.58
8.1.00.0070.00017.58
8.0.300.0040.00418.77
8.0.290.0000.00717.18
8.0.280.0030.00518.47
8.0.270.0030.00317.23
8.0.260.0030.00316.91
8.0.250.0070.00017.03
8.0.240.0020.00517.04
8.0.230.0030.00317.04
8.0.220.0000.00717.02
8.0.210.0000.00716.96
8.0.200.0030.00316.97
8.0.190.0030.00517.04
8.0.180.0030.00517.06
8.0.170.0000.00816.97
8.0.160.0040.00416.85
8.0.150.0000.00716.89
8.0.140.0000.00716.90
8.0.130.0040.00413.41
8.0.120.0040.00416.90
8.0.110.0040.00416.82
8.0.100.0000.00816.89
8.0.90.0080.00016.93
8.0.80.0030.01316.93
8.0.70.0050.00216.79
8.0.60.0060.00317.00
8.0.50.0050.00216.94
8.0.30.0140.00617.21
8.0.20.0100.00817.40
8.0.10.0000.00717.02
8.0.00.0100.00916.65
7.4.330.0000.00715.00
7.4.320.0030.00316.42
7.4.300.0000.00616.61
7.4.290.0030.00616.54
7.4.280.0040.00316.53
7.4.270.0000.00716.63
7.4.260.0040.00416.54
7.4.250.0070.00016.47
7.4.240.0000.00716.56
7.4.230.0000.00716.41
7.4.220.0170.00316.50
7.4.210.0050.00916.60
7.4.200.0000.00716.69
7.4.190.0070.00016.47
7.4.160.0000.01616.44
7.4.150.0100.01317.40
7.4.140.0120.00617.86
7.4.130.0100.01116.51
7.4.120.0120.00916.48
7.4.110.0110.00716.66
7.4.100.0170.00816.53
7.4.90.0090.00916.65
7.4.80.0070.01819.39
7.4.70.0140.00916.59
7.4.60.0090.00916.56
7.4.50.0000.00816.58
7.4.40.0060.00922.77
7.4.30.0030.01516.50
7.4.00.0050.01014.89
7.3.330.0030.00313.35
7.3.320.0050.00013.25
7.3.310.0050.00216.42
7.3.300.0070.00016.39
7.3.290.0130.00316.40
7.3.280.0110.00816.38
7.3.270.0070.01017.40
7.3.260.0130.01016.43
7.3.250.0120.00816.66
7.3.240.0100.00716.52
7.3.230.0070.01016.66
7.3.210.0100.00716.65
7.3.200.0090.00919.39
7.3.190.0110.01116.58
7.3.180.0060.01216.50
7.3.170.0110.01116.51
7.3.160.0110.00416.54
7.3.120.0100.00514.90
7.3.110.0070.01014.84
7.3.100.0090.00914.63
7.3.90.0060.00315.05
7.3.80.0040.01114.94
7.3.70.0030.01214.80
7.3.60.0070.00714.78
7.3.50.0080.00414.71
7.3.40.0100.00314.98
7.3.30.0030.00914.89
7.3.20.0070.01016.47
7.3.10.0000.01016.72
7.3.00.0100.00616.82
7.2.330.0070.01116.48
7.2.320.0090.01616.71
7.2.310.0080.01616.63
7.2.300.0060.01216.71
7.2.290.0070.01016.65
7.2.250.0110.00715.21
7.2.240.0130.00715.28
7.2.230.0040.00815.24
7.2.220.0000.01314.96
7.2.210.0000.01714.78
7.2.200.0090.00614.87
7.2.190.0000.01715.29
7.2.180.0090.00915.15
7.2.170.0070.00315.22
7.2.60.0090.00616.99
7.1.330.0000.01315.96
7.1.320.0030.00915.66
7.1.310.0060.01015.61
7.1.300.0030.01215.57
7.1.290.0040.00815.80
7.1.280.0080.00415.59
7.1.270.0000.01115.64
7.1.260.0000.01315.64
7.1.200.0120.00315.76
7.1.70.0000.00917.30
7.1.60.0120.01219.82
7.1.50.0070.01817.04
7.1.00.0030.07722.44
7.0.200.0030.00716.64
7.0.140.0030.07322.16
7.0.60.0100.08019.91
7.0.50.0030.05717.74
7.0.40.0070.05720.25
7.0.30.0300.07320.23
7.0.20.0130.05720.09
7.0.10.0270.04020.19
7.0.00.0100.07020.33
5.6.280.0030.07721.13
5.6.210.0030.07720.55
5.6.200.0070.08318.24
5.6.190.0100.08020.47
5.6.180.3130.04020.50
5.6.170.0170.04320.55
5.6.160.0000.05320.53
5.6.150.0070.07718.28
5.6.140.0070.08318.18
5.6.130.0070.06318.12
5.6.120.0070.08321.00
5.6.110.0130.06721.15
5.6.100.0070.04321.15
5.6.90.0170.07320.98
5.6.80.0100.05020.39
5.5.350.0100.07020.30
5.5.340.0100.07017.96
5.5.330.0130.08020.38
5.5.320.0230.07720.25
5.5.310.0270.07720.34
5.5.300.0100.03717.99
5.5.290.0130.03318.09
5.5.280.0030.09320.81
5.5.270.0100.06020.88
5.5.260.0100.07320.88
5.5.250.0230.07720.63
5.5.240.0070.04020.04
5.4.450.0570.05319.21
5.4.440.0170.06019.57
5.4.430.0100.05319.45
5.4.420.0030.06019.42
5.4.410.0100.05319.28
5.4.400.0830.00018.82
5.4.390.0800.00018.64
5.4.380.0330.05018.76
5.4.370.0270.04018.77
5.4.360.0200.04318.72
5.4.350.0200.05018.52
5.4.340.0100.05718.47
5.4.320.0060.04012.52
5.4.310.0090.03512.52
5.4.300.0050.03812.52
5.4.290.0070.04212.52
5.4.280.0060.03612.41
5.4.270.0230.06318.80
5.4.260.0030.07718.79
5.4.250.0200.06318.75
5.4.240.0070.05718.99
5.4.230.0100.05018.94
5.4.220.0130.06718.76
5.4.210.0200.04019.05
5.4.200.0130.05718.76
5.4.190.0070.06018.74
5.4.180.0130.07318.79
5.4.170.0070.07719.09
5.4.160.0030.07718.82
5.4.150.0100.05718.98
5.4.140.0130.05716.36
5.4.130.0100.06716.40
5.4.120.0170.06716.45
5.4.110.0070.05016.52
5.4.100.0100.06716.57
5.4.90.0170.06716.46
5.4.80.0100.05016.42
5.4.70.0000.07016.52
5.4.60.0130.05716.39
5.4.50.0130.07016.45
5.4.40.0100.04716.65
5.4.30.0070.07016.36
5.4.20.0070.05716.62
5.4.10.0100.04716.39
5.4.00.0200.05316.00
5.3.290.0040.04112.80
5.3.280.0100.07014.45
5.3.270.0200.06714.71
5.3.260.0030.06714.53
5.3.250.0100.05014.65
5.3.240.0170.06314.85
5.3.230.0030.05714.76
5.3.220.0130.07014.81
5.3.210.0100.05714.77
5.3.200.0170.05314.57
5.3.190.0070.06014.61
5.3.180.0030.06314.80
5.3.170.0170.06314.61
5.3.160.0030.06014.81
5.3.150.0170.06314.59
5.3.140.0100.07014.41
5.3.130.0070.05314.73
5.3.120.0100.05314.79
5.3.110.0070.08014.66
5.3.100.0100.05014.27
5.3.90.0230.04714.17
5.3.80.0030.06014.20
5.3.70.0170.05314.12
5.3.60.0170.05714.11
5.3.50.0130.05013.99
5.3.40.0070.05313.97
5.3.30.0100.05014.00
5.3.20.0030.05313.69
5.3.10.0070.07013.66
5.3.00.0200.04313.73
5.2.170.0070.06011.33
5.2.160.0170.03011.17
5.2.150.0030.06711.13
5.2.140.0100.05311.14
5.2.130.0030.05311.11
5.2.120.0100.05311.21
5.2.110.0070.04711.21
5.2.100.0030.04011.11
5.2.90.0070.05311.07
5.2.80.0070.04311.27
5.2.70.0270.04011.27
5.2.60.0170.03711.06
5.2.50.0170.05311.13
5.2.40.0030.04011.02
5.2.30.0170.03310.96
5.2.20.0100.04011.20
5.2.10.0100.05010.71
5.2.00.0030.06010.73
5.1.60.0000.03710.18
5.1.50.0100.0339.88
5.1.40.0100.03010.10
5.1.30.0130.03010.44
5.1.20.0070.05010.54
5.1.10.0070.03710.19
5.1.00.0100.04310.09
5.0.50.0070.0378.61
5.0.40.0030.0378.42
5.0.30.0000.0538.17
5.0.20.0030.0278.31
5.0.10.0030.0278.27
5.0.00.0100.0338.24
4.4.90.0070.0175.82
4.4.80.0030.0275.96
4.4.70.0000.0335.83
4.4.60.0000.0305.84
4.4.50.0000.0235.97
4.4.40.0000.0375.82
4.4.30.0070.0235.85
4.4.20.0100.0275.90
4.4.10.0070.0175.92
4.4.00.0100.0275.89
4.3.110.0030.0205.78
4.3.100.0000.0235.78
4.3.90.0030.0275.80
4.3.80.0030.0335.78
4.3.70.0100.0135.78
4.3.60.0030.0205.78
4.3.50.0030.0205.78
4.3.40.0030.0375.78
4.3.30.0000.0275.78
4.3.20.0030.0305.78
4.3.10.0030.0235.78
4.3.00.0000.0236.51

preferences:
62.81 ms | 401 KiB | 5 Q