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 $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 = 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(); $test->doFunction(array_merge(range(0,25), range('a','z'))) . "<hr />"; //echo $test->stores; 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.0040.01818.43
8.3.50.0090.00922.00
8.3.40.0070.01419.01
8.3.30.0140.00019.07
8.3.20.0040.00420.14
8.3.10.0080.00021.96
8.3.00.0080.00022.52
8.2.180.0150.00616.75
8.2.170.0140.00722.96
8.2.160.0120.00622.04
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0090.00026.16
8.2.120.0040.00419.35
8.2.110.0100.00022.25
8.2.100.0110.00018.34
8.2.90.0080.00019.25
8.2.80.0000.00917.97
8.2.70.0060.00317.49
8.2.60.0090.00017.93
8.2.50.0080.00018.07
8.2.40.0060.00318.22
8.2.30.0070.00318.02
8.2.20.0000.00817.80
8.2.10.0040.00417.89
8.2.00.0040.00419.46
8.1.280.0140.00325.92
8.1.270.0030.00621.99
8.1.260.0040.00426.35
8.1.250.0050.00328.09
8.1.240.0000.00923.91
8.1.230.0080.00319.04
8.1.220.0090.00017.74
8.1.210.0080.00018.77
8.1.200.0000.01017.35
8.1.190.0000.00817.41
8.1.180.0000.00918.10
8.1.170.0000.00818.64
8.1.160.0040.00421.96
8.1.150.0000.00718.68
8.1.140.0050.00217.41
8.1.130.0040.00417.86
8.1.120.0040.00417.52
8.1.110.0000.00917.47
8.1.100.0000.00717.52
8.1.90.0000.00817.41
8.1.80.0000.00717.48
8.1.70.0060.00317.42
8.1.60.0090.00317.51
8.1.50.0050.00517.59
8.1.40.0000.00817.54
8.1.30.0040.00417.56
8.1.20.0000.00817.71
8.1.10.0070.00017.52
8.1.00.0050.00317.46
8.0.300.0030.00618.77
8.0.290.0040.00417.30
8.0.280.0050.00318.46
8.0.270.0070.00017.21
8.0.260.0030.00316.84
8.0.250.0070.00017.10
8.0.240.0000.00716.90
8.0.230.0000.00717.04
8.0.220.0030.00316.88
8.0.210.0040.00417.02
8.0.200.0030.00317.07
8.0.190.0040.00417.03
8.0.180.0000.00717.08
8.0.170.0000.00816.91
8.0.160.0040.00416.90
8.0.150.0080.00016.85
8.0.140.0040.00416.96
8.0.130.0030.00313.38
8.0.120.0000.00816.85
8.0.110.0020.00517.01
8.0.100.0060.00316.98
8.0.90.0040.00416.93
8.0.80.0060.00916.99
8.0.70.0000.00717.02
8.0.60.0040.00416.84
8.0.50.0000.00717.00
8.0.30.0070.01217.14
8.0.20.0100.00917.41
8.0.10.0000.00717.08
8.0.00.0080.01216.81
7.4.330.0000.00615.00
7.4.320.0030.00316.63
7.4.300.0060.00016.54
7.4.290.0030.00316.66
7.4.280.0040.00416.64
7.4.270.0000.00616.54
7.4.260.0000.00716.55
7.4.250.0000.00716.49
7.4.240.0040.00416.60
7.4.230.0040.00416.71
7.4.220.0070.01016.54
7.4.210.0120.00716.65
7.4.200.0030.00316.34
7.4.190.0000.00716.49
7.4.160.0090.01216.45
7.4.150.0040.01317.40
7.4.140.0070.01317.86
7.4.130.0110.00816.45
7.4.120.0100.00816.70
7.4.110.0120.01216.82
7.4.100.0150.00416.52
7.4.90.0120.00616.75
7.4.80.0100.01019.39
7.4.70.0070.01016.71
7.4.60.0060.01316.50
7.4.50.0000.00816.46
7.4.40.0150.00322.77
7.4.30.0100.00716.61
7.4.00.0110.00715.10
7.3.330.0030.00313.29
7.3.320.0050.00013.41
7.3.310.0030.00316.36
7.3.300.0050.00316.33
7.3.290.0060.01316.46
7.3.280.0090.00916.45
7.3.270.0130.00417.40
7.3.260.0100.00616.63
7.3.250.0110.00616.62
7.3.240.0160.00416.61
7.3.230.0170.00716.44
7.3.210.0030.01816.61
7.3.200.0100.00619.39
7.3.190.0100.00716.64
7.3.180.0090.00716.52
7.3.170.0090.00616.55
7.3.160.0060.01016.71
7.3.120.0080.00615.05
7.3.10.0080.01216.39
7.3.00.0160.00316.11
7.2.330.0060.01316.89
7.2.320.0120.01216.65
7.2.310.0140.00316.82
7.2.300.0140.00716.63
7.2.290.0090.01416.61
7.2.130.0000.01316.41
7.2.120.0170.01016.70
7.2.110.0150.00416.16
7.2.100.0180.00916.50
7.2.90.0110.01116.41
7.2.80.0110.01116.26
7.2.70.0140.00716.82
7.2.60.0180.00216.63
7.2.50.0170.00316.65
7.2.40.0170.00416.72
7.2.30.0160.01216.39
7.2.20.0140.01416.73
7.2.10.0120.01216.40
7.2.00.0110.01017.91
7.1.250.0150.00615.25
7.1.200.0060.00615.82
7.1.100.0100.00318.19
7.1.70.0040.00417.27
7.1.60.0130.01019.82
7.1.50.0070.01516.79
7.1.00.0100.07022.45
7.0.200.0030.00616.86
7.0.140.0030.07721.92
7.0.60.0070.08720.07
7.0.50.0030.04017.92
7.0.40.0200.07320.40
7.0.30.0370.07720.19
7.0.20.0270.06720.23
7.0.10.0170.08020.21
7.0.00.0030.04320.14
5.6.280.0070.07021.12
5.6.210.0070.05020.71
5.6.200.0030.05318.16
5.6.190.0070.04320.63
5.6.180.3500.03720.42
5.6.170.0270.06020.46
5.6.160.0100.03320.71
5.6.150.0000.08718.24
5.6.140.0100.07718.16
5.6.130.0070.07018.34
5.6.120.0000.04321.16
5.6.110.0100.08020.94
5.6.100.0000.04321.12
5.6.90.0070.06720.96
5.6.80.0130.05020.45
5.5.350.0100.05720.41
5.5.340.0030.04317.95
5.5.330.0000.08020.19
5.5.320.0230.03320.35
5.5.310.0230.04720.37
5.5.300.0000.04018.05
5.5.290.0070.03718.08
5.5.280.0100.05320.79
5.5.270.0000.09020.69
5.5.260.0330.04320.69
5.5.250.0070.07020.59
5.5.240.0070.04320.16
5.4.450.0300.04319.52
5.4.440.0230.04319.17
5.4.430.0230.04319.60
5.4.420.0330.05719.20
5.4.410.0330.07319.15
5.4.400.0370.06718.86
5.4.390.0300.03719.15
5.4.380.0370.05019.19
5.4.370.0200.05019.24
5.4.360.0200.03719.15
5.4.350.0230.04719.08
5.4.340.0200.04318.94
5.4.320.0230.04018.95
5.4.310.0300.05018.87
5.4.300.0330.05719.14
5.4.290.0200.04718.81
5.4.280.0300.05719.10
5.4.270.0300.04019.23
5.4.260.0300.03019.06
5.4.250.0300.04318.84
5.4.240.0230.04319.16
5.4.230.0400.06018.93
5.4.220.0330.05719.25
5.4.210.0430.03719.16
5.4.200.0330.06318.84
5.4.190.0270.07319.14
5.4.180.0330.06319.07
5.4.170.0270.03718.95
5.4.160.0330.06019.16
5.4.150.0300.04019.25
5.4.140.0270.04316.40
5.4.130.0230.06716.40
5.4.120.0230.04316.38
5.4.110.0170.03716.59
5.4.100.0270.04016.56
5.4.90.0300.04016.55
5.4.80.0300.04716.44
5.4.70.0230.05316.30
5.4.60.0230.07316.39
5.4.50.0200.04716.54
5.4.40.0300.06716.55
5.4.30.0300.06716.50
5.4.20.0370.05716.44
5.4.10.0200.04016.37
5.4.00.0370.05015.80
5.3.290.0200.04314.61
5.3.280.0230.04714.73
5.3.270.0270.06014.71
5.3.260.0270.07314.62
5.3.250.0330.04714.54
5.3.240.0300.06314.70
5.3.230.0300.06314.55
5.3.220.0270.07714.49
5.3.210.0300.05014.64
5.3.200.0270.06314.56
5.3.190.0230.07714.66
5.3.180.0200.03714.64
5.3.170.0200.04314.81
5.3.160.0270.07314.59
5.3.150.0370.06014.56
5.3.140.0200.06714.58
5.3.130.0270.07714.58
5.3.120.0330.05714.69
5.3.110.0270.06314.65
5.3.100.0200.06014.29
5.3.90.0300.06714.26
5.3.80.0300.05014.05
5.3.70.0170.04714.02
5.3.60.0300.04014.03
5.3.50.0370.06714.13
5.3.40.0200.04013.88
5.3.30.0270.04013.88
5.3.20.0270.04013.88
5.3.10.0200.03713.59
5.3.00.0300.03313.57
5.2.170.0170.04011.28
5.2.160.0230.05011.18
5.2.150.0200.03011.11
5.2.140.0230.03711.10
5.2.130.0270.05011.22
5.2.120.0270.03311.06
5.2.110.0300.02011.21
5.2.100.0170.05711.08
5.2.90.0300.05011.05
5.2.80.0230.03711.04
5.2.70.0230.03011.14
5.2.60.0300.05311.29
5.2.50.0300.03311.02
5.2.40.0200.03011.07
5.2.30.0200.04010.92
5.2.20.0200.04011.04
5.2.10.0170.05710.93
5.2.00.0130.05310.86
5.1.60.0100.03310.86
5.1.50.0200.02310.86
5.1.40.0100.04310.86
5.1.30.0170.04310.86
5.1.20.0200.05010.86
5.1.10.0170.03010.86
5.1.00.0130.03010.86
5.0.50.0070.03310.86
5.0.40.0070.02010.86
5.0.30.0070.03010.86
5.0.20.0070.04310.86
5.0.10.0100.02310.86
5.0.00.0070.05310.86
4.4.90.0100.01710.86
4.4.80.0130.03010.86
4.4.70.0070.01710.86
4.4.60.0170.01710.86
4.4.50.0070.02310.86
4.4.40.0070.05310.86
4.4.30.0030.01710.86
4.4.20.0170.02310.86
4.4.10.0130.03310.86
4.4.00.0030.02710.86
4.3.110.0070.01310.86
4.3.100.0100.01310.86
4.3.90.0100.01710.86
4.3.80.0100.02310.86
4.3.70.0070.03010.86
4.3.60.0100.03310.86
4.3.50.0070.02310.86
4.3.40.0130.04310.86
4.3.30.0000.03310.86
4.3.20.0030.03310.86
4.3.10.0030.02310.86
4.3.00.0030.01710.86

preferences:
29.8 ms | 401 KiB | 5 Q