3v4l.org

run code in 300+ PHP versions simultaneously
<?php class testCase { private $stores; public function doFunction($items = array(), $out ) { foreach($items as $num => $val) { 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? */ //$out = "<br />"; } return $this->store = $out; } /* PRIVATE, SO NOT ACCESSIBLE! FIX: make public */ 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; } } $test = new testCase(); //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"); print_r(array_merge(range(0,25), range('a','z'))); /* 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.01418.43
8.3.50.0110.00922.08
8.3.40.0120.00318.73
8.3.30.0100.00719.21
8.3.20.0040.00420.31
8.3.10.0050.00322.09
8.3.00.0000.00722.57
8.2.180.0160.00617.00
8.2.170.0070.00722.96
8.2.160.0100.00322.08
8.2.150.0030.00524.18
8.2.140.0080.00024.66
8.2.130.0080.00026.16
8.2.120.0030.00717.63
8.2.110.0060.00322.13
8.2.100.0040.00818.03
8.2.90.0080.00019.21
8.2.80.0000.00817.97
8.2.70.0000.00817.50
8.2.60.0030.00618.16
8.2.50.0000.00818.07
8.2.40.0080.00018.16
8.2.30.0070.00018.03
8.2.20.0000.00717.61
8.2.10.0000.00819.34
8.2.00.0030.00617.61
8.1.280.0100.00725.92
8.1.270.0000.00922.14
8.1.260.0080.00026.35
8.1.250.0050.00328.09
8.1.240.0090.00023.77
8.1.230.0070.00418.91
8.1.220.0000.00817.74
8.1.210.0000.00818.77
8.1.200.0040.00417.36
8.1.190.0000.00917.52
8.1.180.0070.00318.10
8.1.170.0040.00418.53
8.1.160.0000.00722.02
8.1.150.0040.00418.69
8.1.140.0000.00817.47
8.1.130.0000.00717.84
8.1.120.0050.00317.48
8.1.110.0000.00717.34
8.1.100.0040.00417.37
8.1.90.0040.00417.34
8.1.80.0000.00717.41
8.1.70.0000.00717.42
8.1.60.0030.00617.48
8.1.50.0080.00017.54
8.1.40.0000.00817.56
8.1.30.0050.00217.64
8.1.20.0040.00417.63
8.1.10.0000.00817.59
8.1.00.0050.00317.57
8.0.300.0040.00418.77
8.0.290.0040.00417.18
8.0.280.0040.00418.40
8.0.270.0000.00717.34
8.0.260.0000.00616.79
8.0.250.0030.00317.00
8.0.240.0000.01017.05
8.0.230.0000.00717.02
8.0.220.0070.00016.99
8.0.210.0030.00316.94
8.0.200.0040.00416.89
8.0.190.0000.00716.92
8.0.180.0050.00216.98
8.0.170.0030.00617.02
8.0.160.0070.00016.84
8.0.150.0040.00416.80
8.0.140.0050.00216.82
8.0.130.0000.00513.43
8.0.120.0050.00216.91
8.0.110.0040.00416.82
8.0.100.0040.00417.01
8.0.90.0040.00417.03
8.0.80.0090.00916.92
8.0.70.0050.00316.84
8.0.60.0030.00517.04
8.0.50.0040.00417.03
8.0.30.0110.00917.06
8.0.20.0100.00817.40
8.0.10.0000.00717.11
8.0.00.0100.01116.68
7.4.330.0060.00015.14
7.4.320.0030.00316.63
7.4.300.0000.00616.46
7.4.290.0000.01016.59
7.4.280.0030.00516.43
7.4.270.0070.00016.55
7.4.260.0000.00916.40
7.4.250.0040.00416.49
7.4.240.0020.00516.49
7.4.230.0000.00716.69
7.4.220.0070.01016.59
7.4.210.0100.00516.63
7.4.200.0070.00016.64
7.4.190.0000.00716.46
7.4.160.0120.00316.43
7.4.150.0090.00917.40
7.4.140.0080.01017.86
7.4.130.0140.00516.49
7.4.120.0100.00816.46
7.4.110.0120.00316.41
7.4.100.0090.01316.57
7.4.90.0190.00016.60
7.4.80.0060.01119.39
7.4.70.0040.01316.57
7.4.60.0080.01316.67
7.4.50.0000.00816.48
7.4.40.0000.01422.77
7.4.30.0050.01116.47
7.4.00.0060.01015.21
7.3.330.0000.00513.34
7.3.320.0000.00613.37
7.3.310.0000.00716.43
7.3.300.0070.00016.44
7.3.290.0060.00916.39
7.3.280.0100.00616.45
7.3.270.0120.00617.40
7.3.260.0070.01016.43
7.3.250.0120.00716.56
7.3.240.0130.00316.39
7.3.230.0170.00016.60
7.3.210.0080.00816.44
7.3.200.0170.00019.39
7.3.190.0110.01116.48
7.3.180.0040.01116.53
7.3.170.0100.00616.59
7.3.160.0120.00316.50
7.3.120.0030.01315.08
7.2.330.0080.00816.47
7.2.320.0040.01716.68
7.2.310.0060.01116.82
7.2.300.0130.00316.69
7.2.290.0130.00316.72
7.2.60.0080.00816.82
7.2.00.0000.01319.58
7.1.200.0030.00915.79
7.1.100.0100.00318.22
7.1.70.0040.00417.05
7.1.60.0100.01619.82
7.1.50.0140.01016.86
7.1.00.0000.08022.35
7.0.200.0050.00316.59
7.0.140.0030.07021.92
7.0.60.0030.04719.84
7.0.50.0030.04317.97
7.0.40.0030.04320.27
7.0.30.0170.04320.21
7.0.20.0300.07320.10
7.0.10.0470.07020.19
7.0.00.0130.06720.33
5.6.280.0100.07020.90
5.6.210.0130.08020.48
5.6.200.0130.04018.20
5.6.190.0170.07320.52
5.6.180.3870.04020.46
5.6.170.0200.06720.57
5.6.160.0030.04320.50
5.6.150.0070.08318.29
5.6.140.0170.07318.14
5.6.130.0030.08018.28
5.6.120.0030.08021.14
5.6.110.0100.08320.98
5.6.100.0130.08321.14
5.6.90.0070.05021.02
5.6.80.0100.08020.51
5.6.70.0400.04720.28
5.5.350.0070.08020.51
5.5.340.0070.07717.95
5.5.330.0100.04320.21
5.5.320.0230.08320.38
5.5.310.0200.06020.19
5.5.300.0100.04017.94
5.5.290.0070.04018.04
5.5.280.0000.04320.81
5.5.270.0030.04020.77
5.5.260.0070.04320.90
5.5.250.0170.06720.71
5.5.240.0070.04020.20
5.4.450.0500.06319.73
5.4.440.0600.05719.38
5.4.430.0170.06019.52
5.4.420.0030.06019.46
5.4.410.0130.05319.45
5.4.400.0830.00018.95
5.4.390.0870.00018.64
5.4.380.0830.05718.79
5.4.370.0130.05318.48
5.4.360.0170.04718.79
5.4.350.0170.05018.58
5.4.340.0170.05318.76
5.4.320.0070.03712.52
5.4.310.0080.04812.51
5.4.300.0070.03712.51
5.4.290.0090.03612.50
5.4.280.0060.03912.41
5.4.270.0100.06018.95
5.4.260.0130.05319.02
5.4.250.0070.06018.79
5.4.240.0170.07018.64
5.4.230.0000.07018.89
5.4.220.0100.06018.76
5.4.210.0100.06018.75
5.4.200.0200.06018.95
5.4.190.0130.07718.79
5.4.180.0170.06318.75
5.4.170.0170.06319.00
5.4.160.0170.05318.92
5.4.150.0200.06018.97
5.4.140.0200.04316.59
5.4.130.0170.06316.45
5.4.120.0130.07316.44
5.4.110.0200.05016.48
5.4.100.0130.05716.48
5.4.90.0070.06016.39
5.4.80.0100.05016.50
5.4.70.0070.05316.35
5.4.60.0200.06016.36
5.4.50.0000.06716.59
5.4.40.0070.05316.38
5.4.30.0130.05016.50
5.4.20.0130.05316.47
5.4.10.0130.07016.31
5.4.00.0200.05715.98
5.3.290.0060.04412.80
5.3.280.0100.06314.59
5.3.270.0130.05714.47
5.3.260.0100.05714.79
5.3.250.0200.05014.79
5.3.240.0170.06714.80
5.3.230.0030.06314.83
5.3.220.0170.05314.48
5.3.210.0200.05714.55
5.3.200.0070.05014.56
5.3.190.0100.07314.72
5.3.180.0070.07714.62
5.3.170.0170.05714.65
5.3.160.0130.05014.43
5.3.150.0200.04314.66
5.3.140.0100.07714.70
5.3.130.0100.07014.56
5.3.120.0100.08014.74
5.3.110.0200.07014.57
5.3.100.0200.04314.23
5.3.90.0170.06014.12
5.3.80.0130.06714.11
5.3.70.0170.06014.02
5.3.60.0200.06014.01
5.3.50.0000.07014.13
5.3.40.0170.04714.05
5.3.30.0130.04713.82
5.3.20.0030.05713.79
5.3.10.0130.05713.82
5.3.00.0200.05013.73
5.2.170.0070.04711.25
5.2.160.0030.06311.23
5.2.150.0130.05011.16
5.2.140.0030.06011.05
5.2.130.0070.04711.20
5.2.120.0130.05311.02
5.2.110.0130.03711.10
5.2.100.0070.05011.02
5.2.90.0070.04011.07
5.2.80.0070.06011.10
5.2.70.0100.05311.09
5.2.60.0130.05711.10
5.2.50.0130.05010.94
5.2.40.0070.04011.00
5.2.30.0130.05011.05
5.2.20.0130.04010.95
5.2.10.0030.05310.84
5.2.00.0030.04710.81
5.1.60.0130.0309.93
5.1.50.0100.04310.25
5.1.40.0100.03710.19
5.1.30.0030.05710.55
5.1.20.0100.05010.59
5.1.10.0100.03310.18
5.1.00.0100.03310.32
5.0.50.0100.0278.63
5.0.40.0070.0408.50
5.0.30.0100.0538.21
5.0.20.0030.0408.30
5.0.10.0070.0408.18
5.0.00.0070.0408.15
4.4.90.0070.0176.17
4.4.80.0000.0336.17
4.4.70.0000.0336.17
4.4.60.0000.0336.17
4.4.50.0000.0236.17
4.4.40.0070.0336.17
4.4.30.0030.0236.17
4.4.20.0100.0306.17
4.4.10.0070.0176.17
4.4.00.0100.0376.17
4.3.110.0000.0336.17
4.3.100.0000.0236.17
4.3.90.0100.0236.17
4.3.80.0000.0376.17
4.3.70.0000.0306.17
4.3.60.0030.0206.17
4.3.50.0000.0276.17
4.3.40.0000.0336.17
4.3.30.0000.0306.17
4.3.20.0100.0136.17
4.3.10.0000.0276.17
4.3.00.0030.0276.59

preferences:
45.63 ms | 401 KiB | 5 Q