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, $out ) { foreach($items as $num => $val) { if($num % 2 === 0) { $out += $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.60.0120.00918.44
8.3.50.0180.00221.93
8.3.40.0120.00318.97
8.3.30.0110.00719.21
8.3.20.0040.00420.39
8.3.10.0060.00321.94
8.3.00.0000.00922.52
8.2.180.0110.00716.50
8.2.170.0070.01022.96
8.2.160.0030.01022.17
8.2.150.0050.00324.18
8.2.140.0060.00324.66
8.2.130.0030.00526.16
8.2.120.0050.00517.50
8.2.110.0160.00319.05
8.2.100.0060.00617.89
8.2.90.0000.00919.30
8.2.80.0040.00417.97
8.2.70.0060.00317.75
8.2.60.0090.00018.03
8.2.50.0000.00818.07
8.2.40.0040.00418.22
8.2.30.0000.00718.14
8.2.20.0000.00817.80
8.2.10.0080.00019.61
8.2.00.0050.00317.72
8.1.280.0100.00725.92
8.1.270.0040.00422.18
8.1.260.0030.00626.35
8.1.250.0080.00028.09
8.1.240.0060.00322.05
8.1.230.0090.00319.05
8.1.220.0030.00617.77
8.1.210.0040.00418.77
8.1.200.0030.00617.35
8.1.190.0040.00417.52
8.1.180.0030.00618.10
8.1.170.0030.00618.59
8.1.160.0040.00421.91
8.1.150.0080.00018.65
8.1.140.0040.00417.45
8.1.130.0000.00717.84
8.1.120.0030.00517.45
8.1.110.0070.00017.42
8.1.100.0000.00817.47
8.1.90.0030.00517.37
8.1.80.0040.00417.51
8.1.70.0030.00317.44
8.1.60.0000.01017.61
8.1.50.0040.00417.58
8.1.40.0000.00717.36
8.1.30.0040.00417.71
8.1.20.0050.00317.64
8.1.10.0040.00417.53
8.1.00.0050.00217.44
8.0.300.0000.00818.77
8.0.290.0040.00416.88
8.0.280.0030.00518.46
8.0.270.0070.00017.20
8.0.260.0000.00716.82
8.0.250.0030.00317.01
8.0.240.0040.00417.05
8.0.230.0000.00716.98
8.0.220.0070.00016.89
8.0.210.0030.00316.99
8.0.200.0070.00017.03
8.0.190.0080.00017.03
8.0.180.0040.00417.00
8.0.170.0040.00416.86
8.0.160.0070.00017.02
8.0.150.0070.00017.03
8.0.140.0070.00016.99
8.0.130.0060.00013.36
8.0.120.0030.00616.89
8.0.110.0000.00716.96
8.0.100.0020.00516.86
8.0.90.0000.00816.99
8.0.80.0090.00916.90
8.0.70.0000.00716.77
8.0.60.0050.00216.80
8.0.50.0060.00316.93
8.0.30.0140.00717.11
8.0.20.0100.00917.40
8.0.10.0050.00216.96
8.0.00.0030.01716.76
7.4.330.0000.00715.00
7.4.320.0060.00016.54
7.4.300.0000.00716.63
7.4.290.0040.00716.59
7.4.280.0040.00416.53
7.4.270.0030.00316.62
7.4.260.0040.00716.59
7.4.250.0040.00416.57
7.4.240.0040.00416.53
7.4.230.0040.00416.41
7.4.220.0150.01016.48
7.4.210.0050.01216.59
7.4.200.0000.00716.54
7.4.190.0070.00016.78
7.4.160.0060.00916.47
7.4.150.0190.00717.40
7.4.140.0050.01417.86
7.4.130.0160.00616.66
7.4.120.0100.00816.70
7.4.110.0100.00716.44
7.4.100.0060.01216.69
7.4.90.0100.01716.55
7.4.80.0030.01419.39
7.4.70.0090.00916.59
7.4.60.0070.01016.43
7.4.50.0020.00216.44
7.4.40.0000.01322.77
7.4.30.0110.00616.64
7.4.00.0000.00914.73
7.3.330.0050.00013.45
7.3.320.0050.00013.46
7.3.310.0030.00316.25
7.3.300.0000.00716.30
7.3.290.0060.00916.40
7.3.280.0070.00816.42
7.3.270.0030.01417.40
7.3.260.0030.01316.73
7.3.250.0100.01116.56
7.3.240.0080.00816.72
7.3.230.0060.01116.52
7.3.210.0060.01416.46
7.3.200.0090.00919.39
7.3.190.0100.01016.46
7.3.180.0030.01416.65
7.3.170.0080.00816.35
7.3.160.0100.01016.59
7.3.120.0090.00614.92
7.3.110.0030.01315.00
7.3.100.0040.01214.67
7.3.90.0000.00914.68
7.3.80.0030.01014.88
7.3.70.0030.00614.97
7.3.60.0060.00314.98
7.3.50.0060.00314.79
7.3.40.0090.00614.84
7.3.30.0060.00914.84
7.3.20.0030.00916.52
7.3.10.0060.00616.75
7.3.00.0040.00416.88
7.2.330.0070.01116.66
7.2.320.0030.02116.86
7.2.310.0130.00316.69
7.2.300.0090.00916.66
7.2.290.0100.00716.46
7.2.240.0060.01215.09
7.2.230.0090.00614.99
7.2.220.0030.01015.36
7.2.210.0040.01114.86
7.2.200.0070.01015.04
7.2.190.0030.01014.86
7.2.180.0040.01115.00
7.2.170.0000.01714.81
7.2.160.0080.00415.05
7.2.150.0070.01116.68
7.2.140.0030.01016.89
7.2.130.0030.01017.00
7.2.120.0060.00917.07
7.2.110.0030.00917.09
7.2.100.0110.00416.97
7.2.90.0040.01516.96
7.2.80.0000.01416.79
7.2.70.0030.01216.52
7.2.60.0070.00516.89
7.2.50.0030.01017.13
7.2.40.0120.00016.93
7.2.30.0000.01417.02
7.2.20.0040.00917.07
7.2.10.0110.00716.85
7.2.00.0060.00616.79
7.1.330.0110.00715.87
7.1.320.0000.01215.95
7.1.310.0030.01015.59
7.1.300.0070.00415.61
7.1.290.0000.01415.83
7.1.280.0040.01215.84
7.1.270.0030.00915.82
7.1.260.0080.00415.90
7.1.250.0110.00315.68
7.1.200.0050.00515.93
7.1.70.0030.00317.24
7.1.60.0100.01419.82
7.1.50.0150.01517.01
7.1.00.0030.07722.33
7.0.200.0050.00216.64
7.0.140.0030.07322.09
7.0.60.0000.04319.88
7.0.50.0000.04717.91
7.0.40.0100.03719.96
7.0.30.0270.03320.30
7.0.20.0230.08020.41
7.0.10.0330.07320.15
7.0.00.0070.08020.20
5.6.280.0000.07720.88
5.6.210.0100.08320.48
5.6.200.0030.05018.29
5.6.190.0070.06720.49
5.6.180.3570.04720.67
5.6.170.0100.05020.59
5.6.160.0070.08320.46
5.6.150.0030.09018.19
5.6.140.0070.07018.24
5.6.130.0030.05018.17
5.6.120.0130.07320.98
5.6.110.0200.07021.00
5.6.100.0070.08321.12
5.6.90.0030.08721.01
5.6.80.0100.04720.52
5.6.70.0300.07320.29
5.5.350.0000.08020.36
5.5.340.0200.06717.95
5.5.330.0170.07320.29
5.5.320.0300.07320.52
5.5.310.0270.07320.24
5.5.300.0130.07318.07
5.5.290.0100.06718.07
5.5.280.0070.08020.70
5.5.270.0030.04720.77
5.5.260.0000.07720.84
5.5.250.0030.09020.79
5.5.240.0030.04720.16
5.4.450.0270.05019.12
5.4.440.0330.04719.50
5.4.430.0030.06019.54
5.4.420.0200.06719.55
5.4.410.0030.06319.43
5.4.400.0830.00018.82
5.4.390.0630.00018.52
5.4.380.0370.04318.71
5.4.370.0200.05018.78
5.4.360.0270.04318.76
5.4.350.0300.04318.84
5.4.340.0230.04718.61
5.4.320.0050.03712.51
5.4.310.0080.03812.51
5.4.300.0120.04512.52
5.4.290.0080.04612.51
5.4.280.0060.03812.40
5.4.270.0200.04718.75
5.4.260.0170.06019.01
5.4.250.0100.07318.96
5.4.240.0130.07718.79
5.4.230.0100.05718.95
5.4.220.0100.06018.75
5.4.210.0270.06018.96
5.4.200.0070.06018.64
5.4.190.0130.06719.09
5.4.180.0070.07718.73
5.4.170.0070.07718.95
5.4.160.0100.05018.73
5.4.150.0170.05718.72
5.4.140.0100.05316.51
5.4.130.0030.05316.59
5.4.120.0070.05716.43
5.4.110.0170.05716.46
5.4.100.0100.06716.41
5.4.90.0100.05716.38
5.4.80.0100.05016.47
5.4.70.0030.07716.42
5.4.60.0170.04016.46
5.4.50.0030.05716.34
5.4.40.0000.07016.43
5.4.30.0170.05016.42
5.4.20.0030.05316.45
5.4.10.0230.04716.36
5.4.00.0070.06315.88
5.3.290.0120.05112.80
5.3.280.0100.06714.62
5.3.270.0170.06714.78
5.3.260.0130.05014.70
5.3.250.0070.06714.64
5.3.240.0230.05714.71
5.3.230.0130.07014.52
5.3.220.0130.07014.75
5.3.210.0100.05014.60
5.3.200.0130.05014.74
5.3.190.0170.05714.65
5.3.180.0130.07014.59
5.3.170.0170.04314.60
5.3.160.0130.05014.66
5.3.150.0030.06314.76
5.3.140.0070.07014.66
5.3.130.0030.06714.70
5.3.120.0030.06014.54
5.3.110.0070.07314.58
5.3.100.0130.06714.04
5.3.90.0130.06014.21
5.3.80.0030.05314.11
5.3.70.0130.05313.87
5.3.60.0070.06714.19
5.3.50.0130.04714.13
5.3.40.0000.06014.04
5.3.30.0130.05313.96
5.3.20.0030.06013.61
5.3.10.0100.06713.57
5.3.00.0100.06313.72
5.2.170.0030.05311.14
5.2.160.0130.05311.34
5.2.150.0170.05711.39
5.2.140.0030.04710.99
5.2.130.0070.05711.18
5.2.120.0070.05011.20
5.2.110.0170.04311.11
5.2.100.0130.04711.28
5.2.90.0070.05310.95
5.2.80.0130.04711.19
5.2.70.0030.05311.08
5.2.60.0200.04711.16
5.2.50.0070.06311.04
5.2.40.0100.05011.03
5.2.30.0030.05310.97
5.2.20.0070.04011.06
5.2.10.0130.03711.04
5.2.00.0100.04010.73
5.1.60.0100.03010.17
5.1.50.0030.04710.26
5.1.40.0030.0379.96
5.1.30.0030.04010.34
5.1.20.0030.05710.36
5.1.10.0100.04710.25
5.1.00.0030.04010.15
5.0.50.0070.0278.59
5.0.40.0130.0338.59
5.0.30.0030.0478.24
5.0.20.0030.0408.21
5.0.10.0030.0308.28
5.0.00.0100.0508.38
4.4.90.0100.0235.97
4.4.80.0070.0175.97
4.4.70.0070.0205.97
4.4.60.0070.0205.97
4.4.50.0030.0275.97
4.4.40.0100.0305.97
4.4.30.0070.0205.97
4.4.20.0070.0205.97
4.4.10.0000.0305.97
4.4.00.0030.0435.97
4.3.110.0000.0275.97
4.3.100.0070.0305.97
4.3.90.0000.0335.97
4.3.80.0030.0335.97
4.3.70.0030.0235.97
4.3.60.0100.0175.97
4.3.50.0030.0275.97
4.3.40.0070.0405.97
4.3.30.0000.0275.97
4.3.20.0000.0235.97
4.3.10.0070.0275.97
4.3.00.0200.0176.58

preferences:
49.03 ms | 401 KiB | 5 Q