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->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.0100.01018.56
8.3.50.0170.00622.01
8.3.40.0120.00418.76
8.3.30.0070.00719.21
8.3.20.0030.00620.29
8.3.10.0030.00522.11
8.3.00.0030.00622.43
8.2.180.0070.01016.75
8.2.170.0070.01022.96
8.2.160.0070.00722.13
8.2.150.0080.00024.18
8.2.140.0060.00324.66
8.2.130.0040.00426.16
8.2.120.0100.00017.63
8.2.110.0060.00319.14
8.2.100.0030.00718.03
8.2.90.0030.00619.17
8.2.80.0050.00317.97
8.2.70.0040.00417.50
8.2.60.0040.00417.93
8.2.50.0000.00818.07
8.2.40.0000.00818.34
8.2.30.0000.00718.16
8.2.20.0000.00717.88
8.2.10.0030.00519.59
8.2.00.0070.00317.86
8.1.280.0070.01125.92
8.1.270.0080.00022.01
8.1.260.0080.00026.35
8.1.250.0000.00728.09
8.1.240.0030.00621.37
8.1.230.0080.00317.82
8.1.220.0030.00517.74
8.1.210.0050.00318.77
8.1.200.0030.00617.38
8.1.190.0050.00317.53
8.1.180.0080.00018.10
8.1.170.0030.00618.60
8.1.160.0000.00722.00
8.1.150.0040.00418.68
8.1.140.0070.00017.49
8.1.130.0040.00417.88
8.1.120.0050.00217.44
8.1.110.0050.00217.51
8.1.100.0070.00017.50
8.1.90.0030.00517.50
8.1.80.0000.00817.40
8.1.70.0000.00717.45
8.1.60.0060.00317.61
8.1.50.0000.00817.60
8.1.40.0030.00617.55
8.1.30.0060.00317.58
8.1.20.0030.00517.66
8.1.10.0060.00317.64
8.1.00.0060.00317.63
8.0.300.0040.00418.77
8.0.290.0070.00017.18
8.0.280.0040.00418.50
8.0.270.0000.00817.22
8.0.260.0070.00016.87
8.0.250.0050.00317.12
8.0.240.0000.00717.06
8.0.230.0030.00317.03
8.0.220.0030.00317.04
8.0.210.0040.00416.87
8.0.200.0030.00617.09
8.0.190.0040.00417.01
8.0.180.0000.00716.93
8.0.170.0050.00316.93
8.0.160.0000.00717.01
8.0.150.0000.00716.88
8.0.140.0020.00516.93
8.0.130.0000.00713.47
8.0.120.0050.00316.95
8.0.110.0000.00717.01
8.0.100.0040.00416.86
8.0.90.0030.00616.96
8.0.80.0100.00616.89
8.0.70.0070.00016.89
8.0.60.0000.00716.97
8.0.50.0000.00716.80
8.0.30.0150.00417.27
8.0.20.0100.01017.40
8.0.10.0090.00017.20
8.0.00.0130.00616.70
7.4.330.0040.00415.00
7.4.320.0060.00016.63
7.4.300.0030.00316.55
7.4.290.0070.00316.65
7.4.280.0000.00716.55
7.4.270.0000.00716.70
7.4.260.0030.00716.45
7.4.250.0020.00516.46
7.4.240.0050.00216.51
7.4.230.0000.00716.72
7.4.220.0170.00016.74
7.4.210.0060.01116.52
7.4.200.0000.00716.38
7.4.190.0000.00716.71
7.4.160.0120.00316.62
7.4.150.0180.00017.40
7.4.140.0130.01017.86
7.4.130.0130.00716.63
7.4.120.0070.01016.51
7.4.110.0090.00916.52
7.4.100.0040.01516.42
7.4.90.0090.00916.58
7.4.80.0090.01319.39
7.4.70.0060.01116.51
7.4.60.0090.00916.49
7.4.50.0000.00616.35
7.4.40.0070.01122.77
7.4.30.0070.01016.60
7.4.00.0040.01115.12
7.3.330.0000.00613.29
7.3.320.0000.00513.48
7.3.310.0000.00816.48
7.3.300.0000.00716.49
7.3.290.0100.01016.41
7.3.280.0100.00716.52
7.3.270.0100.01017.40
7.3.260.0100.00716.40
7.3.250.0110.00816.49
7.3.240.0070.01516.57
7.3.230.0060.01016.55
7.3.210.0160.00016.47
7.3.200.0190.00019.39
7.3.190.0080.01416.53
7.3.180.0060.00916.70
7.3.170.0100.00716.41
7.3.160.0040.01116.56
7.3.120.0030.01414.76
7.2.330.0030.01716.71
7.2.320.0120.00916.71
7.2.310.0080.01116.84
7.2.300.0090.00916.78
7.2.290.0130.00316.54
7.2.60.0060.00617.15
7.2.50.0000.00816.79
7.1.200.0030.01015.80
7.1.70.0120.00317.09
7.1.60.0100.01419.82
7.1.50.0040.01817.01
7.1.00.0100.07022.36
7.0.200.0030.00516.64
7.0.140.0030.07721.97
7.0.60.0200.07720.04
7.0.50.0100.04717.91
7.0.40.0030.04720.11
7.0.30.0270.06020.18
7.0.20.0330.07320.23
7.0.10.0100.04020.16
7.0.00.0030.08020.30
5.6.280.0030.07320.94
5.6.210.0230.06320.48
5.6.200.0000.08318.28
5.6.190.0070.08020.58
5.6.180.0270.04320.34
5.6.170.0270.06720.61
5.6.160.0030.04018.27
5.6.150.0030.04318.27
5.6.140.0130.07318.16
5.6.130.0070.09318.16
5.6.120.0100.07321.15
5.6.110.0170.07320.97
5.6.100.0030.08020.99
5.6.90.0000.04321.00
5.6.80.0130.03020.39
5.5.350.0230.06720.45
5.5.340.0070.08018.00
5.5.330.0130.07720.31
5.5.320.0430.04020.34
5.5.310.0270.04720.36
5.5.300.0000.07018.06
5.5.290.0100.07718.01
5.5.280.0100.07720.79
5.5.270.0030.08720.90
5.5.260.0070.05020.69
5.5.250.0100.03720.59
5.5.240.0200.08020.38
5.4.450.0630.06019.17
5.4.440.0700.06319.18
5.4.430.0030.06019.46
5.4.420.0130.05019.55
5.4.410.0030.06318.97
5.4.400.0030.06018.62
5.4.390.0030.06018.71
5.4.380.0170.05018.77
5.4.370.0230.04718.73
5.4.360.0100.05718.77
5.4.350.0070.06318.79
5.4.340.0200.04718.79
5.4.320.0080.04212.52
5.4.310.0090.04812.52
5.4.300.0070.03912.52
5.4.290.0040.04012.52
5.4.280.0060.04512.41
5.4.270.0070.07018.64
5.4.260.0100.06718.94
5.4.250.0200.06718.94
5.4.240.0000.08318.79
5.4.230.0130.07018.76
5.4.220.0200.07018.96
5.4.210.0070.05718.64
5.4.200.0100.07718.96
5.4.190.0270.05018.75
5.4.180.0000.06018.98
5.4.170.0070.07019.09
5.4.160.0200.04018.98
5.4.150.0170.05318.90
5.4.140.0100.05016.64
5.4.130.0030.07716.60
5.4.120.0270.04316.61
5.4.110.0100.08016.53
5.4.100.0070.05316.47
5.4.90.0030.08016.46
5.4.80.0000.06016.39
5.4.70.0070.05316.39
5.4.60.0170.06016.42
5.4.50.0100.04716.32
5.4.40.0130.06316.44
5.4.30.0130.04716.53
5.4.20.0130.04716.43
5.4.10.0270.05016.45
5.4.00.0100.05015.89
5.3.290.0030.04212.80
5.3.280.0130.06014.59
5.3.270.0200.04714.71
5.3.260.0100.05014.72
5.3.250.0070.05314.72
5.3.240.0170.06014.63
5.3.230.0000.06314.78
5.3.220.0000.06014.65
5.3.210.0070.07314.67
5.3.200.0100.06314.56
5.3.190.0130.05314.58
5.3.180.0100.04714.67
5.3.170.0070.06014.57
5.3.160.0100.05014.68
5.3.150.0100.05714.59
5.3.140.0170.06014.74
5.3.130.0130.05714.65
5.3.120.0070.07314.66
5.3.110.0000.06314.61
5.3.100.0070.05013.96
5.3.90.0100.06314.02
5.3.80.0100.05014.12
5.3.70.0030.05714.22
5.3.60.0170.04014.11
5.3.50.0230.05014.04
5.3.40.0100.05314.07
5.3.30.0070.04713.90
5.3.20.0070.06713.80
5.3.10.0070.06013.66
5.3.00.0170.04713.68
5.2.170.0070.04711.02
5.2.160.0070.04311.17
5.2.150.0070.05711.26
5.2.140.0100.06011.25
5.2.130.0030.04311.09
5.2.120.0100.04311.21
5.2.110.0070.04011.29
5.2.100.0100.05010.95
5.2.90.0070.04010.96
5.2.80.0130.04011.27
5.2.70.0170.04711.18
5.2.60.0200.02711.03
5.2.50.0070.04011.22
5.2.40.0100.03711.20
5.2.30.0030.04310.90
5.2.20.0100.05310.81
5.2.10.0030.05310.97
5.2.00.0070.04310.83
5.1.60.0030.0479.94
5.1.50.0070.0439.86
5.1.40.0030.0409.97
5.1.30.0030.04010.43
5.1.20.0030.04010.47
5.1.10.0130.03010.09
5.1.00.0030.04310.13
5.0.50.0030.0408.57
5.0.40.0070.0238.28
5.0.30.0100.0408.35
5.0.20.0070.0378.21
5.0.10.0100.0338.27
5.0.00.0000.0508.43
4.4.90.0000.0335.86
4.4.80.0000.0335.85
4.4.70.0100.0175.85
4.4.60.0000.0235.86
4.4.50.0030.0305.91
4.4.40.0070.0375.84
4.4.30.0100.0205.96
4.4.20.0100.0135.90
4.4.10.0000.0235.88
4.4.00.0030.0435.84
4.3.110.0070.0335.84
4.3.100.0000.0305.84
4.3.90.0030.0305.84
4.3.80.0070.0405.84
4.3.70.0030.0305.84
4.3.60.0000.0335.84
4.3.50.0130.0205.88
4.3.40.0070.0435.84
4.3.30.0030.0305.84
4.3.20.0030.0235.84
4.3.10.0070.0175.84
4.3.00.0100.0236.63

preferences:
46.81 ms | 401 KiB | 5 Q