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 = explode("<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.0170.00318.64
8.3.50.0120.00422.09
8.3.40.0120.00318.69
8.3.30.0110.00319.27
8.3.20.0060.00320.39
8.3.10.0040.00421.89
8.3.00.0000.00822.27
8.2.180.0110.00818.54
8.2.170.0110.00722.96
8.2.160.0100.00721.96
8.2.150.0000.00724.18
8.2.140.0070.00024.66
8.2.130.0030.00626.16
8.2.120.0060.00319.61
8.2.110.0180.00422.25
8.2.100.0100.00717.78
8.2.90.0080.00019.21
8.2.80.0040.00417.97
8.2.70.0050.00317.63
8.2.60.0050.00318.05
8.2.50.0050.00318.07
8.2.40.0040.00417.92
8.2.30.0000.00818.04
8.2.20.0030.00517.77
8.2.10.0030.00619.55
8.2.00.0000.00717.89
8.1.280.0060.00925.92
8.1.270.0070.00023.99
8.1.260.0080.00026.35
8.1.250.0080.00028.09
8.1.240.0060.00323.67
8.1.230.0090.00318.90
8.1.220.0030.00617.77
8.1.210.0000.00818.77
8.1.200.0090.00017.35
8.1.190.0000.00817.54
8.1.180.0080.00018.10
8.1.170.0050.00318.64
8.1.160.0000.00721.96
8.1.150.0000.00718.71
8.1.140.0000.00817.49
8.1.130.0040.00417.74
8.1.120.0040.00417.51
8.1.110.0020.00517.45
8.1.100.0040.00417.54
8.1.90.0040.00417.51
8.1.80.0040.00417.39
8.1.70.0000.00717.47
8.1.60.0060.00317.67
8.1.50.0040.00417.54
8.1.40.0000.00817.54
8.1.30.0000.00817.54
8.1.20.0000.00917.70
8.1.10.0000.00817.59
8.1.00.0040.00417.48
8.0.300.0040.00418.77
8.0.290.0070.00017.04
8.0.280.0030.00418.53
8.0.270.0000.00717.16
8.0.260.0030.00316.88
8.0.250.0000.00817.10
8.0.240.0030.00617.03
8.0.230.0000.00717.09
8.0.220.0030.00516.90
8.0.210.0000.00717.02
8.0.200.0060.00017.08
8.0.190.0000.00817.10
8.0.180.0000.00716.95
8.0.170.0030.00516.89
8.0.160.0000.00816.99
8.0.150.0070.00016.90
8.0.140.0000.00716.98
8.0.130.0000.00713.46
8.0.120.0000.00817.00
8.0.110.0000.00717.01
8.0.100.0070.00016.82
8.0.90.0000.00817.00
8.0.80.0090.00616.88
8.0.70.0040.00417.01
8.0.60.0000.00716.79
8.0.50.0040.00416.86
8.0.30.0140.00617.20
8.0.20.0150.01117.40
8.0.10.0000.00717.04
8.0.00.0110.00916.97
7.4.330.0000.00615.00
7.4.320.0030.00316.55
7.4.300.0000.00616.55
7.4.290.0060.00316.56
7.4.280.0070.00016.63
7.4.270.0000.00716.44
7.4.260.0070.00016.52
7.4.250.0030.00616.61
7.4.240.0040.00416.60
7.4.230.0000.00716.66
7.4.220.0100.00716.66
7.4.210.0070.00916.61
7.4.200.0070.00016.56
7.4.190.0030.00316.41
7.4.160.0080.00816.44
7.4.150.0110.00717.40
7.4.140.0070.01017.86
7.4.130.0080.01016.51
7.4.120.0060.01116.57
7.4.110.0030.01316.34
7.4.100.0090.00916.61
7.4.90.0070.01016.58
7.4.80.0090.00919.39
7.4.70.0080.01116.64
7.4.60.0100.00716.75
7.4.50.0030.00316.38
7.4.40.0050.00522.77
7.4.30.0080.00816.71
7.4.00.0100.00714.63
7.3.330.0060.00013.40
7.3.320.0050.00013.41
7.3.310.0070.00016.42
7.3.300.0070.00016.47
7.3.290.0130.00716.41
7.3.280.0070.01016.47
7.3.270.0070.01017.40
7.3.260.0060.01216.39
7.3.250.0130.00816.50
7.3.240.0100.00716.46
7.3.230.0030.01416.63
7.3.210.0090.00916.61
7.3.200.0100.00719.39
7.3.190.0190.00416.60
7.3.180.0030.01316.56
7.3.170.0070.01016.44
7.3.160.0100.01016.49
7.3.120.0070.00714.83
7.3.110.0000.01115.04
7.3.100.0040.01214.98
7.3.90.0070.00715.06
7.3.80.0030.00914.90
7.3.70.0070.00714.63
7.3.60.0070.00714.77
7.3.50.0070.00714.54
7.3.40.0040.01114.83
7.3.30.0000.01014.92
7.3.20.0070.01116.74
7.3.10.0100.00316.71
7.3.00.0070.01016.41
7.2.330.0110.00816.88
7.2.320.0120.01216.50
7.2.310.0120.01216.82
7.2.300.0070.01016.40
7.2.290.0090.00616.82
7.2.240.0050.00515.03
7.2.230.0000.01615.01
7.2.220.0120.00614.91
7.2.210.0070.01015.06
7.2.200.0090.00615.04
7.2.190.0030.01415.00
7.2.180.0060.01015.04
7.2.170.0040.01515.14
7.2.160.0110.00014.79
7.2.150.0110.00416.59
7.2.140.0060.01016.90
7.2.130.0100.00316.98
7.2.120.0090.00916.98
7.2.110.0070.01017.05
7.2.100.0030.01016.86
7.2.90.0090.00616.93
7.2.80.0030.01317.00
7.2.70.0080.00316.55
7.2.60.0090.00816.87
7.2.50.0030.01116.80
7.2.40.0030.01616.90
7.2.30.0070.00716.94
7.2.20.0030.00917.08
7.2.10.0070.01116.98
7.2.00.0020.01218.09
7.1.330.0120.00315.87
7.1.320.0070.00715.90
7.1.310.0070.00715.67
7.1.300.0000.01015.71
7.1.290.0030.01015.88
7.1.280.0120.00315.61
7.1.270.0060.01015.79
7.1.260.0080.00816.02
7.1.250.0030.01315.48
7.1.200.0000.01115.92
7.1.100.0000.00918.23
7.1.70.0000.00917.14
7.1.60.0100.01419.82
7.1.50.0060.00617.11
7.1.00.0030.07722.51
7.0.200.0000.00916.82
7.0.140.0070.07021.92
7.0.60.0100.03319.89
7.0.50.0000.04717.93
7.0.40.0000.04720.35
7.0.30.0130.04720.20
7.0.20.0170.05020.15
7.0.10.0300.07720.06
7.0.00.0030.06720.23
5.6.280.0000.07721.12
5.6.210.0070.04720.72
5.6.200.0070.08318.21
5.6.190.0070.05720.57
5.6.180.4070.04020.55
5.6.170.0300.07720.40
5.6.160.0030.04720.54
5.6.150.0030.05018.14
5.6.140.0100.04018.24
5.6.130.0100.07718.25
5.6.120.0170.07321.03
5.6.110.0130.06721.01
5.6.100.0100.08720.96
5.6.90.0170.07020.99
5.6.80.0100.07720.38
5.6.70.0300.07720.36
5.5.350.0030.06720.36
5.5.340.0000.04317.98
5.5.330.0070.08020.37
5.5.320.0200.08320.35
5.5.310.0170.08320.27
5.5.300.0100.06717.98
5.5.290.0070.06717.93
5.5.280.0030.04320.90
5.5.270.0000.04720.75
5.5.260.0100.03720.99
5.5.250.0100.07020.63
5.5.240.0030.03720.17
5.4.450.0470.07019.39
5.4.440.0670.05319.55
5.4.430.0130.05319.32
5.4.420.0070.06019.41
5.4.410.0100.07719.32
5.4.400.0830.00018.51
5.4.390.0830.00018.77
5.4.380.0170.05318.74
5.4.370.0170.05318.60
5.4.360.0070.06018.52
5.4.350.0200.05018.55
5.4.340.0170.05318.54
5.4.320.0060.03712.52
5.4.310.0050.04312.52
5.4.300.0070.04012.52
5.4.290.0050.03912.52
5.4.280.0070.04212.42
5.4.270.0130.04718.99
5.4.260.0170.06318.79
5.4.250.0170.05318.80
5.4.240.0000.07719.02
5.4.230.0030.05718.79
5.4.220.0170.08018.98
5.4.210.0200.06318.96
5.4.200.0170.04718.75
5.4.190.0100.05318.79
5.4.180.0000.08318.90
5.4.170.0130.05318.93
5.4.160.0070.05318.78
5.4.150.0100.06018.77
5.4.140.0030.07316.46
5.4.130.0200.03716.36
5.4.120.0100.07316.44
5.4.110.0230.04016.56
5.4.100.0100.04716.48
5.4.90.0130.04316.57
5.4.80.0130.04316.66
5.4.70.0130.05316.44
5.4.60.0100.05716.40
5.4.50.0130.05016.48
5.4.40.0030.05316.57
5.4.30.0070.06016.51
5.4.20.0200.04716.51
5.4.10.0170.07316.38
5.4.00.0100.06715.77
5.3.290.0060.04912.80
5.3.280.0200.06014.84
5.3.270.0070.05714.65
5.3.260.0070.06014.71
5.3.250.0170.04714.79
5.3.240.0270.04314.65
5.3.230.0100.07014.45
5.3.220.0100.06014.59
5.3.210.0200.04714.61
5.3.200.0100.04714.56
5.3.190.0100.07314.67
5.3.180.0100.05014.67
5.3.170.0000.05714.68
5.3.160.0100.05714.73
5.3.150.0130.04714.77
5.3.140.0100.05714.59
5.3.130.0070.07714.71
5.3.120.0030.06014.71
5.3.110.0100.05014.48
5.3.100.0030.05014.14
5.3.90.0030.07314.18
5.3.80.0070.06013.95
5.3.70.0100.05314.03
5.3.60.0100.07014.08
5.3.50.0100.04713.80
5.3.40.0130.06714.14
5.3.30.0030.05313.95
5.3.20.0030.05013.79
5.3.10.0070.07013.86
5.3.00.0100.06713.75
5.2.170.0100.05011.25
5.2.160.0130.03311.13
5.2.150.0200.03711.39
5.2.140.0130.05011.23
5.2.130.0030.04311.11
5.2.120.0100.05311.21
5.2.110.0070.04010.96
5.2.100.0100.03711.08
5.2.90.0100.03311.29
5.2.80.0100.04311.09
5.2.70.0030.04311.20
5.2.60.0230.04311.15
5.2.50.0030.05711.00
5.2.40.0030.04311.20
5.2.30.0030.05010.98
5.2.20.0100.04311.14
5.2.10.0100.05011.11
5.2.00.0100.04710.73
5.1.60.0070.04710.02
5.1.50.0100.03010.04
5.1.40.0030.0379.96
5.1.30.0070.03710.52
5.1.20.0030.05310.46
5.1.10.0070.04710.07
5.1.00.0030.04310.09
5.0.50.0130.0378.67
5.0.40.0070.0278.50
5.0.30.0000.0678.23
5.0.20.0030.0338.38
5.0.10.0030.0308.30
5.0.00.0030.0438.17
4.4.90.0030.0206.33
4.4.80.0030.0376.33
4.4.70.0070.0176.33
4.4.60.0030.0376.33
4.4.50.0030.0276.33
4.4.40.0130.0336.28
4.4.30.0070.0206.27
4.4.20.0000.0236.27
4.4.10.0030.0206.27
4.4.00.0070.0436.27
4.3.110.0030.0206.27
4.3.100.0030.0206.27
4.3.90.0030.0276.27
4.3.80.0100.0336.27
4.3.70.0030.0276.27
4.3.60.0070.0236.27
4.3.50.0070.0236.27
4.3.40.0030.0476.27
4.3.30.0030.0206.27
4.3.20.0030.0276.27
4.3.10.0070.0276.27
4.3.00.0130.0236.49

preferences:
42.15 ms | 401 KiB | 5 Q