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.0140.00718.43
8.3.50.0180.00522.11
8.3.40.0090.00918.84
8.3.30.0130.00318.95
8.3.20.0000.00720.19
8.3.10.0080.00022.10
8.3.00.0000.00822.32
8.2.180.0100.01016.88
8.2.170.0150.00322.96
8.2.160.0140.00022.20
8.2.150.0040.00424.18
8.2.140.0000.00824.66
8.2.130.0040.00426.16
8.2.120.0110.00017.75
8.2.110.0170.00321.18
8.2.100.0080.00618.02
8.2.90.0040.00419.17
8.2.80.0040.00417.97
8.2.70.0060.00317.60
8.2.60.0030.00618.03
8.2.50.0040.00418.07
8.2.40.0020.00518.28
8.2.30.0070.00018.08
8.2.20.0000.00817.55
8.2.10.0080.00019.53
8.2.00.0000.00917.51
8.1.280.0070.01025.92
8.1.270.0030.00522.15
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0030.00722.14
8.1.230.0080.00318.93
8.1.220.0000.00817.79
8.1.210.0000.00918.77
8.1.200.0030.00617.23
8.1.190.0000.00917.35
8.1.180.0060.00318.10
8.1.170.0000.00818.66
8.1.160.0050.00222.09
8.1.150.0000.00818.64
8.1.140.0040.00417.38
8.1.130.0070.00017.81
8.1.120.0030.00417.36
8.1.110.0020.00517.38
8.1.100.0000.00717.50
8.1.90.0000.00817.45
8.1.80.0000.00717.34
8.1.70.0030.00317.48
8.1.60.0000.00917.48
8.1.50.0000.00717.41
8.1.40.0030.00517.43
8.1.30.0040.00417.69
8.1.20.0050.00317.68
8.1.10.0000.00717.54
8.1.00.0050.00217.50
8.0.300.0000.00720.07
8.0.290.0090.00016.88
8.0.280.0000.00818.51
8.0.270.0030.00317.19
8.0.260.0000.00616.81
8.0.250.0070.00017.10
8.0.240.0060.00317.01
8.0.230.0000.00716.86
8.0.220.0040.00416.83
8.0.210.0000.00716.99
8.0.200.0070.00017.00
8.0.190.0030.00517.05
8.0.180.0080.00016.95
8.0.170.0070.00016.96
8.0.160.0040.00416.96
8.0.150.0050.00216.84
8.0.140.0030.00516.84
8.0.130.0030.00313.33
8.0.120.0070.00016.81
8.0.110.0040.00416.99
8.0.100.0000.00716.84
8.0.90.0060.00316.88
8.0.80.0090.00616.93
8.0.70.0000.00816.86
8.0.60.0040.00417.02
8.0.50.0000.00817.01
8.0.30.0110.00816.99
8.0.20.0070.01317.40
8.0.10.0000.00717.12
8.0.00.0100.01016.69
7.4.330.0060.00015.00
7.4.320.0060.00016.44
7.4.300.0000.00616.60
7.4.290.0030.00716.66
7.4.280.0000.00716.62
7.4.270.0030.00316.41
7.4.260.0000.01016.49
7.4.250.0000.00716.41
7.4.240.0020.00516.58
7.4.230.0040.00416.41
7.4.220.0090.00916.46
7.4.210.0090.00816.57
7.4.200.0000.00716.54
7.4.190.0040.00416.66
7.4.160.0090.00616.69
7.4.150.0120.00617.40
7.4.140.0100.00817.86
7.4.130.0090.01116.53
7.4.120.0090.00816.56
7.4.110.0030.01316.77
7.4.100.0060.01716.66
7.4.90.0090.01416.59
7.4.80.0180.00319.39
7.4.70.0070.01016.39
7.4.60.0170.00016.61
7.4.50.0000.00816.46
7.4.40.0040.00822.77
7.4.30.0090.01216.43
7.4.00.0070.00715.03
7.3.330.0000.00513.26
7.3.320.0030.00313.20
7.3.310.0060.00016.50
7.3.300.0030.00316.34
7.3.290.0000.01616.36
7.3.280.0100.00616.38
7.3.270.0120.00617.40
7.3.260.0100.00716.40
7.3.250.0070.01416.56
7.3.240.0060.01616.54
7.3.230.0090.00616.39
7.3.210.0100.01016.48
7.3.200.0110.00619.39
7.3.190.0160.00616.38
7.3.180.0070.01016.38
7.3.170.0050.01116.38
7.3.160.0090.00816.57
7.3.120.0030.01314.84
7.2.330.0140.00916.71
7.2.320.0110.01116.74
7.2.310.0030.01416.46
7.2.300.0070.01416.77
7.2.290.0150.00016.66
7.1.70.0000.00716.97
7.1.60.0060.01619.82
7.1.50.0040.01116.89
7.1.00.0100.09022.45
7.0.200.0000.00816.88
7.0.140.0030.07321.95
7.0.60.0100.08020.09
7.0.50.0130.07017.86
7.0.40.0100.05720.04
7.0.30.0300.07020.30
7.0.20.0330.07320.07
7.0.10.0070.08320.07
7.0.00.0170.04320.33
5.6.280.0070.07320.93
5.6.210.0100.07320.52
5.6.200.0000.07718.19
5.6.190.0030.05020.61
5.6.180.0270.07020.63
5.6.170.0200.04720.47
5.6.160.0130.07720.55
5.6.150.0030.04718.21
5.6.140.0100.07018.11
5.6.130.0030.06318.17
5.6.120.0130.07720.98
5.6.110.0130.05021.01
5.6.100.0100.08020.94
5.6.90.0100.03320.88
5.6.80.0200.06020.38
5.5.350.0370.06320.30
5.5.340.0100.08017.99
5.5.330.0030.09020.43
5.5.320.0070.04320.36
5.5.310.0300.06320.33
5.5.300.0100.03317.98
5.5.290.0000.05317.98
5.5.280.0170.06720.97
5.5.270.0130.06720.67
5.5.260.0100.06320.77
5.5.250.0100.08320.59
5.5.240.0070.08720.27
5.4.450.0500.06019.49
5.4.440.0200.05019.30
5.4.430.0100.06019.61
5.4.420.0170.05019.21
5.4.410.0070.05719.44
5.4.400.0770.00018.62
5.4.390.0870.00018.79
5.4.380.0230.05718.77
5.4.370.0370.03318.61
5.4.360.0200.04718.63
5.4.350.0100.06018.77
5.4.340.0130.05318.74
5.4.320.0080.04012.51
5.4.310.0040.04312.51
5.4.300.0060.04112.51
5.4.290.0060.04012.51
5.4.280.0070.03812.41
5.4.270.0100.06719.00
5.4.260.0130.05718.83
5.4.250.0130.07719.09
5.4.240.0130.05318.80
5.4.230.0130.06718.98
5.4.220.0270.05318.96
5.4.210.0070.06318.80
5.4.200.0030.08318.95
5.4.190.0070.06318.89
5.4.180.0130.07319.09
5.4.170.0100.06318.95
5.4.160.0070.07718.93
5.4.150.0170.06718.73
5.4.140.0100.05716.43
5.4.130.0330.04716.58
5.4.120.0100.06016.40
5.4.110.0070.05316.34
5.4.100.0130.05016.35
5.4.90.0170.04716.35
5.4.80.0270.04316.39
5.4.70.0130.05716.60
5.4.60.0170.06716.59
5.4.50.0030.07016.38
5.4.40.0070.05316.41
5.4.30.0100.06316.43
5.4.20.0270.04016.41
5.4.10.0070.07716.43
5.4.00.0200.06315.77
5.3.290.0100.04712.80
5.3.280.0170.06314.61
5.3.270.0030.06014.64
5.3.260.0030.06314.68
5.3.250.0100.05314.62
5.3.240.0100.07714.70
5.3.230.0030.05314.51
5.3.220.0170.04714.76
5.3.210.0030.07714.60
5.3.200.0070.06314.74
5.3.190.0100.06014.66
5.3.180.0070.05314.71
5.3.170.0070.05714.74
5.3.160.0070.05314.64
5.3.150.0100.06014.56
5.3.140.0030.05714.64
5.3.130.0170.07314.63
5.3.120.0100.06314.46
5.3.110.0170.08014.39
5.3.100.0070.06314.07
5.3.90.0000.06314.03
5.3.80.0130.06314.07
5.3.70.0170.06014.10
5.3.60.0030.05714.10
5.3.50.0100.04714.05
5.3.40.0070.05713.95
5.3.30.0170.06314.00
5.3.20.0100.04713.88
5.3.10.0100.06313.88
5.3.00.0030.05713.71
5.2.170.0100.06011.14
5.2.160.0070.06011.13
5.2.150.0130.03711.11
5.2.140.0030.06710.98
5.2.130.0000.06011.02
5.2.120.0130.04011.20
5.2.110.0030.04711.20
5.2.100.0130.04011.20
5.2.90.0070.05711.18
5.2.80.0070.04711.26
5.2.70.0070.04311.01
5.2.60.0030.04710.90
5.2.50.0070.04711.12
5.2.40.0170.04711.23
5.2.30.0070.05010.89
5.2.20.0100.05311.05
5.2.10.0030.04310.84
5.2.00.0130.05010.81
5.1.60.0100.04710.11
5.1.50.0030.03710.11
5.1.40.0130.04710.00
5.1.30.0070.05010.43
5.1.20.0070.04010.34
5.1.10.0200.03710.15
5.1.00.0100.03010.32
5.0.50.0070.0308.66
5.0.40.0030.0408.40
5.0.30.0030.0438.20
5.0.20.0030.0278.36
5.0.10.0000.0338.20
5.0.00.0070.0408.23
4.4.90.0100.0205.95
4.4.80.0030.0305.95
4.4.70.0030.0205.95
4.4.60.0030.0235.95
4.4.50.0030.0235.95
4.4.40.0030.0405.95
4.4.30.0030.0275.95
4.4.20.0000.0335.95
4.4.10.0100.0205.95
4.4.00.0070.0305.95
4.3.110.0070.0235.95
4.3.100.0000.0305.95
4.3.90.0070.0235.95
4.3.80.0000.0335.95
4.3.70.0030.0205.95
4.3.60.0070.0275.95
4.3.50.0100.0235.95
4.3.40.0030.0435.91
4.3.30.0000.0235.89
4.3.20.0030.0275.86
4.3.10.0030.0235.84
4.3.00.0100.0237.18

preferences:
42.27 ms | 401 KiB | 5 Q