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); 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.60.0070.01118.54
8.3.50.0110.00521.98
8.3.40.0090.00618.98
8.3.30.0120.00319.26
8.3.20.0080.00020.37
8.3.10.0000.00822.09
8.3.00.0040.00422.44
8.2.180.0070.00716.63
8.2.170.0070.00722.96
8.2.160.0140.00022.26
8.2.150.0040.00424.18
8.2.140.0050.00324.66
8.2.130.0080.00026.16
8.2.120.0050.00319.48
8.2.110.0090.00022.43
8.2.100.0040.00819.76
8.2.90.0060.00319.17
8.2.80.0050.00317.97
8.2.70.0000.00817.75
8.2.60.0000.00817.93
8.2.50.0030.00518.07
8.2.40.0070.00018.16
8.2.30.0040.00418.08
8.2.20.0050.00217.82
8.2.10.0040.00419.59
8.2.00.0120.00017.88
8.1.280.0090.00925.92
8.1.270.0080.00022.02
8.1.260.0000.00726.35
8.1.250.0050.00228.09
8.1.240.0040.00423.85
8.1.230.0060.00619.00
8.1.220.0050.00317.74
8.1.210.0080.00018.77
8.1.200.0000.01017.35
8.1.190.0000.00817.51
8.1.180.0060.00318.10
8.1.170.0060.00318.59
8.1.160.0000.00722.02
8.1.150.0050.00318.67
8.1.140.0050.00217.46
8.1.130.0050.00217.92
8.1.120.0000.00717.39
8.1.110.0050.00217.51
8.1.100.0070.00017.46
8.1.90.0070.00017.46
8.1.80.0040.00417.40
8.1.70.0070.00017.43
8.1.60.0030.00517.49
8.1.50.0030.00517.45
8.1.40.0080.00017.57
8.1.30.0000.00817.50
8.1.20.0090.00017.71
8.1.10.0040.00417.62
8.1.00.0050.00517.59
8.0.300.0000.00718.77
8.0.290.0040.00417.30
8.0.280.0030.00318.36
8.0.270.0000.00717.21
8.0.260.0000.00616.92
8.0.250.0030.00317.10
8.0.240.0070.00017.04
8.0.230.0040.00417.12
8.0.220.0070.00017.02
8.0.210.0040.00416.96
8.0.200.0000.00616.97
8.0.190.0080.00017.08
8.0.180.0000.00717.03
8.0.170.0040.00416.89
8.0.160.0000.00716.93
8.0.150.0070.00016.91
8.0.140.0000.00816.92
8.0.130.0040.00413.47
8.0.120.0030.00616.91
8.0.110.0000.00816.83
8.0.100.0000.00816.81
8.0.90.0040.00417.04
8.0.80.0140.00916.89
8.0.70.0040.00416.91
8.0.60.0070.00017.02
8.0.50.0000.00817.03
8.0.30.0120.00617.23
8.0.20.0110.00817.41
8.0.10.0040.00417.15
8.0.00.0160.00516.78
7.4.330.0000.00515.03
7.4.320.0000.00616.65
7.4.300.0030.00316.55
7.4.290.0030.00716.40
7.4.280.0030.00316.66
7.4.270.0000.00716.59
7.4.260.0030.00516.50
7.4.250.0030.00516.65
7.4.240.0050.00316.57
7.4.230.0070.00016.63
7.4.220.0120.00616.59
7.4.210.0050.01216.52
7.4.200.0000.00816.75
7.4.190.0080.00016.73
7.4.160.0000.01516.55
7.4.150.0070.01117.40
7.4.140.0110.00617.86
7.4.130.0080.01116.55
7.4.120.0110.00816.47
7.4.110.0160.00016.61
7.4.100.0040.01716.61
7.4.90.0090.00916.66
7.4.80.0170.00719.39
7.4.70.0080.01216.69
7.4.60.0060.01016.52
7.4.50.0040.00416.30
7.4.40.0030.01322.77
7.4.30.0170.00016.57
7.4.00.0070.00814.95
7.3.330.0000.00613.29
7.3.320.0000.00513.33
7.3.310.0000.00716.50
7.3.300.0000.00716.30
7.3.290.0160.00716.43
7.3.280.0110.00816.50
7.3.270.0070.01017.40
7.3.260.0050.01116.46
7.3.250.0120.00716.51
7.3.240.0120.00416.48
7.3.230.0040.01516.68
7.3.210.0060.01116.71
7.3.200.0070.01119.39
7.3.190.0130.01016.72
7.3.180.0060.00916.49
7.3.170.0090.01216.46
7.3.160.0080.00816.71
7.3.120.0090.00715.05
7.3.110.0000.01915.13
7.3.100.0060.00614.95
7.3.90.0060.00314.95
7.3.80.0070.00714.76
7.3.70.0100.00315.02
7.3.60.0070.00714.93
7.3.50.0040.00814.72
7.3.40.0060.00914.96
7.3.30.0060.00314.67
7.3.20.0030.01016.51
7.3.10.0100.00316.91
7.3.00.0040.00816.67
7.2.330.0140.00316.81
7.2.320.0100.01116.52
7.2.310.0070.01016.55
7.2.300.0070.01016.82
7.2.290.0110.00616.64
7.2.250.0030.01615.27
7.2.240.0070.01314.92
7.2.230.0030.01415.11
7.2.220.0120.00015.08
7.2.210.0040.01115.13
7.2.200.0030.01015.17
7.2.190.0030.00614.99
7.2.180.0030.01315.19
7.2.170.0030.01315.23
7.2.60.0110.00316.78
7.2.00.0060.01319.06
7.1.330.0060.00915.74
7.1.320.0000.01015.82
7.1.310.0070.00715.91
7.1.300.0060.00615.65
7.1.290.0040.01115.73
7.1.280.0060.00915.61
7.1.270.0000.01215.86
7.1.260.0090.00615.61
7.1.200.0130.00015.77
7.1.100.0030.00618.25
7.1.70.0000.01017.13
7.1.60.0070.01719.82
7.1.50.0100.00616.93
7.1.00.0000.09722.45
7.0.200.0000.01016.79
7.0.140.0030.06722.10
7.0.60.0030.04020.09
7.0.50.0100.08017.89
7.0.40.0130.08319.91
7.0.30.0430.05720.17
7.0.20.0270.08020.23
7.0.10.0070.07720.19
7.0.00.0070.04020.30
5.6.280.0000.07721.09
5.6.210.0100.06320.62
5.6.200.0030.04718.19
5.6.190.0000.08020.68
5.6.180.3670.04020.77
5.6.170.0230.05320.48
5.6.160.0130.05020.46
5.6.150.0100.03318.27
5.6.140.0030.05318.16
5.6.130.0030.08018.27
5.6.120.0100.06721.13
5.6.110.0000.09021.08
5.6.100.0130.04721.12
5.6.90.0070.08320.96
5.6.80.0200.07020.52
5.6.70.4170.03720.41
5.5.350.0330.07320.34
5.5.340.0070.04018.08
5.5.330.0170.07720.57
5.5.320.0230.07320.24
5.5.310.0230.07320.30
5.5.300.0070.08017.95
5.5.290.0070.03717.95
5.5.280.0100.03720.89
5.5.270.0030.07720.85
5.5.260.0130.04720.79
5.5.250.0100.08320.73
5.5.240.0230.08320.30
5.4.450.0300.06719.55
5.4.440.0800.05719.39
5.4.430.0070.05719.52
5.4.420.0130.05719.48
5.4.410.0170.04719.04
5.4.400.0030.08718.74
5.4.390.0100.05318.63
5.4.380.0170.05718.80
5.4.370.0300.04318.86
5.4.360.0200.04718.80
5.4.350.0200.05018.58
5.4.340.0200.04318.63
5.4.320.0080.03612.52
5.4.310.0090.04312.52
5.4.300.0060.04012.53
5.4.290.0060.04712.52
5.4.280.0080.04112.42
5.4.270.0200.06718.74
5.4.260.0000.05718.85
5.4.250.0100.06718.96
5.4.240.0100.05018.66
5.4.230.0130.04718.79
5.4.220.0100.07718.94
5.4.210.0130.06319.11
5.4.200.0170.06718.74
5.4.190.0130.05019.02
5.4.180.0100.05318.85
5.4.170.0100.05719.01
5.4.160.0170.05718.98
5.4.150.0270.05018.77
5.4.140.0130.05716.45
5.4.130.0100.06316.47
5.4.120.0100.05016.63
5.4.110.0070.06016.52
5.4.100.0070.05316.54
5.4.90.0130.04316.68
5.4.80.0170.04016.46
5.4.70.0170.05016.48
5.4.60.0130.06016.40
5.4.50.0070.04716.40
5.4.40.0130.06716.45
5.4.30.0170.04016.52
5.4.20.0030.07016.53
5.4.10.0130.05716.38
5.4.00.0130.05316.03
5.3.290.0110.04612.80
5.3.280.0270.05314.70
5.3.270.0100.05714.69
5.3.260.0100.05014.61
5.3.250.0070.07314.48
5.3.240.0130.04314.61
5.3.230.0100.05714.60
5.3.220.0000.06014.68
5.3.210.0130.06314.50
5.3.200.0170.06314.58
5.3.190.0030.05714.68
5.3.180.0030.06714.68
5.3.170.0100.04714.49
5.3.160.0000.06014.68
5.3.150.0100.07314.57
5.3.140.0100.05714.55
5.3.130.0170.05714.65
5.3.120.0030.07714.65
5.3.110.0070.07014.75
5.3.100.0070.05714.14
5.3.90.0100.05014.03
5.3.80.0070.07714.12
5.3.70.0100.06314.13
5.3.60.0200.05714.01
5.3.50.0070.05314.13
5.3.40.0030.07314.05
5.3.30.0070.06713.91
5.3.20.0130.06013.54
5.3.10.0100.04313.69
5.3.00.0030.07713.73
5.2.170.0030.05311.26
5.2.160.0030.04311.00
5.2.150.0100.05011.14
5.2.140.0070.04011.16
5.2.130.0030.04311.21
5.2.120.0100.05311.20
5.2.110.0130.04311.21
5.2.100.0070.04011.30
5.2.90.0030.04311.20
5.2.80.0070.05711.20
5.2.70.0100.05311.10
5.2.60.0030.04311.30
5.2.50.0070.04710.95
5.2.40.0170.04311.10
5.2.30.0130.03711.08
5.2.20.0000.06010.97
5.2.10.0070.04010.85
5.2.00.0100.04010.83
5.1.60.0030.04710.18
5.1.50.0030.0439.86
5.1.40.0070.0339.96
5.1.30.0030.03710.43
5.1.20.0070.05310.21
5.1.10.0030.03710.19
5.1.00.0030.0509.93
5.0.50.0030.0338.53
5.0.40.0100.0278.40
5.0.30.0070.0508.18
5.0.20.0000.0308.14
5.0.10.0030.0308.36
5.0.00.0070.0508.43
4.4.90.0030.0305.86
4.4.80.0070.0235.81
4.4.70.0070.0235.81
4.4.60.0000.0235.84
4.4.50.0000.0235.78
4.4.40.0030.0335.83
4.4.30.0030.0205.82
4.4.20.0100.0235.86
4.4.10.0000.0235.91
4.4.00.0000.0435.88
4.3.110.0000.0335.79
4.3.100.0070.0235.80
4.3.90.0070.0235.82
4.3.80.0030.0435.78
4.3.70.0000.0235.78
4.3.60.0030.0275.78
4.3.50.0030.0305.78
4.3.40.0070.0405.78
4.3.30.0070.0205.78
4.3.20.0000.0235.78
4.3.10.0030.0175.78
4.3.00.0000.0236.63

preferences:
38.13 ms | 401 KiB | 5 Q