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 { public $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.0120.00918.68
8.3.50.0170.00521.89
8.3.40.0120.00619.05
8.3.30.0030.01019.04
8.3.20.0090.00020.36
8.3.10.0000.00822.02
8.3.00.0040.00422.40
8.2.180.0140.00716.88
8.2.170.0040.01122.96
8.2.160.0100.00322.18
8.2.150.0040.00424.18
8.2.140.0150.00024.66
8.2.130.0070.00026.16
8.2.120.0050.00319.95
8.2.110.0050.00522.29
8.2.100.0090.00319.43
8.2.90.0000.00919.22
8.2.80.0040.00417.97
8.2.70.0050.00317.75
8.2.60.0000.00817.93
8.2.50.0000.00818.07
8.2.40.0040.00418.34
8.2.30.0000.00718.18
8.2.20.0000.00717.70
8.2.10.0030.00619.52
8.2.00.0030.00617.90
8.1.280.0040.01125.92
8.1.270.0040.00422.23
8.1.260.0060.00326.35
8.1.250.0030.00628.09
8.1.240.0000.00823.79
8.1.230.0110.00019.22
8.1.220.0060.00317.80
8.1.210.0000.00818.77
8.1.200.0060.00317.36
8.1.190.0060.00317.53
8.1.180.0040.00418.10
8.1.170.0090.00018.66
8.1.160.0040.00422.11
8.1.150.0000.00818.69
8.1.140.0070.00017.56
8.1.130.0040.00417.79
8.1.120.0000.00717.51
8.1.110.0080.00017.40
8.1.100.0040.00417.52
8.1.90.0000.00817.43
8.1.80.0040.00417.53
8.1.70.0030.00317.49
8.1.60.0000.00817.52
8.1.50.0000.00817.59
8.1.40.0000.00817.46
8.1.30.0000.01017.71
8.1.20.0030.00517.66
8.1.10.0040.00417.69
8.1.00.0040.00417.57
8.0.300.0040.00418.77
8.0.290.0040.00417.30
8.0.280.0070.00018.56
8.0.270.0030.00317.32
8.0.260.0030.00316.92
8.0.250.0030.00317.11
8.0.240.0030.00317.05
8.0.230.0030.00317.09
8.0.220.0050.00217.00
8.0.210.0030.00316.87
8.0.200.0000.00717.11
8.0.190.0040.00417.02
8.0.180.0070.00016.91
8.0.170.0050.00317.03
8.0.160.0000.00916.95
8.0.150.0000.00816.85
8.0.140.0050.00316.93
8.0.130.0000.00513.46
8.0.120.0080.00016.97
8.0.110.0000.00716.89
8.0.100.0070.00016.95
8.0.90.0040.00416.99
8.0.80.0050.01117.00
8.0.70.0030.00617.07
8.0.60.0070.00017.00
8.0.50.0000.00716.80
8.0.30.0080.01317.22
8.0.20.0100.00817.40
8.0.10.0040.00417.08
8.0.00.0080.01116.82
7.4.330.0070.00015.00
7.4.320.0000.00716.67
7.4.300.0000.00616.57
7.4.290.0070.00316.55
7.4.280.0000.00716.64
7.4.270.0030.00316.42
7.4.260.0060.00316.62
7.4.250.0040.00416.37
7.4.240.0040.00416.57
7.4.230.0000.00716.66
7.4.220.0070.01016.64
7.4.210.0140.00216.61
7.4.200.0000.00716.64
7.4.190.0030.00316.60
7.4.160.0050.01016.64
7.4.150.0100.01017.40
7.4.140.0070.01017.86
7.4.130.0120.01016.54
7.4.120.0050.01216.66
7.4.110.0130.00316.55
7.4.100.0130.00716.49
7.4.90.0090.00916.50
7.4.80.0100.00719.39
7.4.70.0200.00016.52
7.4.60.0000.01616.52
7.4.50.0080.00016.27
7.4.40.0110.00722.77
7.4.30.0080.00816.34
7.4.00.0100.00714.94
7.3.330.0050.00013.46
7.3.320.0050.00013.43
7.3.310.0070.00016.29
7.3.300.0000.00716.35
7.3.290.0110.00416.43
7.3.280.0100.00816.46
7.3.270.0110.00617.40
7.3.260.0150.00416.39
7.3.250.0070.01416.60
7.3.240.0100.00716.42
7.3.230.0140.00316.61
7.3.210.0040.01216.54
7.3.200.0120.00919.39
7.3.190.0070.01016.49
7.3.180.0130.00316.41
7.3.170.0100.01016.65
7.3.160.0100.00616.43
7.3.120.0020.01414.90
7.3.110.0060.00915.07
7.3.100.0120.00314.73
7.3.90.0070.01014.89
7.3.80.0000.01015.04
7.3.70.0060.00315.05
7.3.60.0030.01214.99
7.3.50.0150.00315.04
7.3.40.0110.00714.83
7.3.30.0140.00714.96
7.3.20.0060.00616.52
7.3.10.0100.00316.54
7.3.00.0070.01016.70
7.2.330.0110.01116.47
7.2.320.0150.01216.50
7.2.310.0090.01216.95
7.2.300.0060.01316.88
7.2.290.0060.01016.64
7.2.250.0070.01115.19
7.2.240.0090.00614.95
7.2.230.0030.00714.97
7.2.220.0060.01314.76
7.2.210.0060.00615.39
7.2.200.0060.00915.08
7.2.190.0090.00315.06
7.2.180.0030.01315.25
7.2.170.0110.00715.19
7.2.60.0080.00816.56
7.2.00.0000.01119.24
7.1.330.0100.00315.67
7.1.320.0070.00715.91
7.1.310.0040.01115.55
7.1.300.0110.00415.86
7.1.290.0070.00415.59
7.1.280.0100.00715.80
7.1.270.0040.01815.58
7.1.260.0080.00515.82
7.1.200.0100.00315.84
7.1.100.0040.01117.99
7.1.70.0000.01016.96
7.1.60.0110.01519.82
7.1.50.0060.00916.84
7.1.00.0030.07722.28
7.0.200.0030.00716.64
7.0.140.0030.07322.02
7.0.60.0170.06320.07
7.0.50.0030.04017.83
7.0.40.0100.08320.11
7.0.30.0330.07020.11
7.0.20.0230.05320.14
7.0.10.0030.09020.08
7.0.00.0030.05020.25
5.6.280.0130.06321.13
5.6.210.0100.08020.72
5.6.200.0070.07318.18
5.6.190.0100.06320.48
5.6.180.0270.07720.42
5.6.170.0300.07720.55
5.6.160.0070.04020.39
5.6.150.0030.05018.19
5.6.140.0070.08018.21
5.6.130.0030.06018.16
5.6.120.0070.08021.00
5.6.110.0200.04721.04
5.6.100.0030.08721.03
5.6.90.0100.08720.98
5.6.80.0100.03320.48
5.6.70.4530.04020.43
5.5.350.0200.07320.50
5.5.340.0000.04718.09
5.5.330.0100.08020.40
5.5.320.0230.03720.27
5.5.310.0200.08720.34
5.5.300.0100.07318.09
5.5.290.0130.05718.02
5.5.280.0070.08020.81
5.5.270.0100.03320.66
5.5.260.0100.08320.74
5.5.250.0030.08320.67
5.5.240.0000.04020.20
5.4.450.0270.05719.18
5.4.440.0570.05719.33
5.4.430.0070.05719.39
5.4.420.0170.05019.68
5.4.410.0030.06019.33
5.4.400.1070.00018.82
5.4.390.0830.00018.76
5.4.380.0330.05318.61
5.4.370.0070.06018.78
5.4.360.0170.05018.63
5.4.350.0170.05318.76
5.4.340.0200.04318.48
5.4.320.0060.03612.52
5.4.310.0060.04412.52
5.4.300.0040.03812.52
5.4.290.0100.04712.52
5.4.280.0060.03512.41
5.4.270.0170.05318.98
5.4.260.0100.05319.11
5.4.250.0070.06018.95
5.4.240.0070.06318.98
5.4.230.0130.06718.79
5.4.220.0130.05019.00
5.4.210.0030.07018.84
5.4.200.0100.05319.02
5.4.190.0030.07018.99
5.4.180.0170.06319.09
5.4.170.0100.05018.95
5.4.160.0100.05718.97
5.4.150.0200.05718.99
5.4.140.0170.04316.59
5.4.130.0230.06716.61
5.4.120.0130.04716.63
5.4.110.0170.05016.59
5.4.100.0070.07016.71
5.4.90.0130.04716.54
5.4.80.0100.05316.66
5.4.70.0100.06316.50
5.4.60.0130.07716.54
5.4.50.0100.05016.62
5.4.40.0170.06016.43
5.4.30.0170.04016.36
5.4.20.0100.05716.48
5.4.10.0130.05016.47
5.4.00.0170.06715.89
5.3.290.0100.03812.80
5.3.280.0130.06314.80
5.3.270.0070.06314.62
5.3.260.0170.06014.70
5.3.250.0100.05314.62
5.3.240.0000.07314.85
5.3.230.0130.07014.71
5.3.220.0070.06314.65
5.3.210.0200.05314.58
5.3.200.0230.06014.81
5.3.190.0070.07014.59
5.3.180.0100.07314.68
5.3.170.0130.06314.56
5.3.160.0000.06014.75
5.3.150.0030.08014.61
5.3.140.0070.05314.48
5.3.130.0100.06014.65
5.3.120.0130.07014.71
5.3.110.0070.05314.57
5.3.100.0170.04314.23
5.3.90.0030.08014.03
5.3.80.0130.07014.01
5.3.70.0070.05014.21
5.3.60.0130.05314.03
5.3.50.0100.06314.04
5.3.40.0130.06014.15
5.3.30.0030.07013.92
5.3.20.0100.06713.74
5.3.10.0170.05713.65
5.3.00.0130.04313.63
5.2.170.0030.04711.34
5.2.160.0030.05311.26
5.2.150.0000.05011.26
5.2.140.0070.06311.13
5.2.130.0200.03011.11
5.2.120.0170.03711.20
5.2.110.0030.05311.20
5.2.100.0070.05711.20
5.2.90.0030.06011.21
5.2.80.0130.05311.10
5.2.70.0030.06311.19
5.2.60.0130.03710.91
5.2.50.0130.04311.13
5.2.40.0070.04310.94
5.2.30.0070.04310.95
5.2.20.0070.06011.20
5.2.10.0030.05311.10
5.2.00.0030.04310.83
5.1.60.0100.02710.06
5.1.50.0100.04010.00
5.1.40.0070.03710.10
5.1.30.0070.04710.45
5.1.20.0100.04310.45
5.1.10.0130.04010.05
5.1.00.0100.05010.09
5.0.50.0070.0408.55
5.0.40.0000.0308.51
5.0.30.0100.0508.21
5.0.20.0030.0278.19
5.0.10.0030.0378.21
5.0.00.0000.0438.28
4.4.90.0070.0205.91
4.4.80.0000.0275.91
4.4.70.0100.0235.91
4.4.60.0030.0275.91
4.4.50.0030.0235.91
4.4.40.0030.0405.91
4.4.30.0000.0235.91
4.4.20.0000.0235.96
4.4.10.0070.0275.91
4.4.00.0000.0375.93
4.3.110.0030.0205.91
4.3.100.0000.0235.91
4.3.90.0030.0275.91
4.3.80.0070.0305.91
4.3.70.0030.0205.91
4.3.60.0030.0205.91
4.3.50.0000.0235.91
4.3.40.0030.0435.91
4.3.30.0030.0205.91
4.3.20.0000.0305.91
4.3.10.0030.0235.91
4.3.00.0100.0236.51

preferences:
46.99 ms | 401 KiB | 5 Q