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; } } class testCase1 { private $stores; public function doFunction($items, $out ) { foreach($items as $num => $val) { if($num%2 == 0) { $out = $val; } else { $out = strtoupper($val); } $out = "<br />"; } return $this->store = $out; } 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 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.0100.01018.68
8.3.50.0070.01118.17
8.3.40.0120.00618.92
8.3.30.0100.00719.04
8.3.20.0050.00320.16
8.3.10.0090.00021.96
8.3.00.0070.00022.15
8.2.180.0150.00616.63
8.2.170.0170.00022.96
8.2.160.0090.00622.17
8.2.150.0000.00824.18
8.2.140.0080.00024.66
8.2.130.0030.00626.16
8.2.120.0100.00017.75
8.2.110.0050.00519.39
8.2.100.0030.00917.78
8.2.90.0000.00819.21
8.2.80.0000.00817.97
8.2.70.0040.00817.50
8.2.60.0080.00017.80
8.2.50.0000.00818.07
8.2.40.0070.00018.22
8.2.30.0040.00418.00
8.2.20.0040.00417.54
8.2.10.0000.00819.46
8.2.00.0040.00417.74
8.1.270.0040.00422.06
8.1.260.0040.00426.35
8.1.250.0000.00728.09
8.1.240.0030.00621.33
8.1.230.0040.00817.45
8.1.220.0090.00017.78
8.1.210.0040.00418.77
8.1.200.0100.00017.22
8.1.190.0040.00417.25
8.1.180.0100.00018.10
8.1.170.0030.00518.46
8.1.160.0040.00422.02
8.1.150.0080.00018.68
8.1.140.0070.00017.38
8.1.130.0040.00417.78
8.1.120.0040.00417.47
8.1.110.0050.00217.31
8.1.100.0000.00717.45
8.1.90.0040.00417.31
8.1.80.0070.00017.50
8.1.70.0000.00717.34
8.1.60.0100.00017.58
8.1.50.0040.00417.42
8.1.40.0000.00817.56
8.1.30.0000.00817.59
8.1.20.0000.00817.71
8.1.10.0000.00817.59
8.1.00.0040.00417.50
8.0.300.0050.00318.77
8.0.290.0040.00416.88
8.0.280.0030.00318.37
8.0.270.0000.00717.35
8.0.260.0030.00316.90
8.0.250.0000.00716.91
8.0.240.0090.00017.02
8.0.230.0040.00416.89
8.0.220.0070.00017.04
8.0.210.0030.00316.93
8.0.200.0000.00816.98
8.0.190.0040.00417.07
8.0.180.0000.00717.05
8.0.170.0040.00416.95
8.0.160.0000.00716.92
8.0.150.0030.00616.96
8.0.140.0040.00416.94
8.0.130.0000.00913.39
8.0.120.0080.00016.93
8.0.110.0000.00716.89
8.0.100.0030.00516.86
8.0.90.0000.00916.80
8.0.80.0090.00916.88
8.0.70.0050.00316.91
8.0.60.0040.00416.82
8.0.50.0080.00016.93
8.0.30.0080.01317.09
8.0.20.0070.01217.40
8.0.10.0040.00416.96
8.0.00.0110.01016.73
7.4.330.0030.00315.00
7.4.320.0030.00316.62
7.4.300.0000.00616.51
7.4.290.0060.00316.44
7.4.280.0070.00016.58
7.4.270.0000.00716.61
7.4.260.0050.00516.50
7.4.250.0040.00416.63
7.4.240.0040.00316.58
7.4.230.0030.00316.48
7.4.220.0060.01416.56
7.4.210.0050.00916.58
7.4.200.0000.00716.71
7.4.190.0030.00316.57
7.4.160.0060.00916.48
7.4.150.0150.00617.40
7.4.140.0090.01217.86
7.4.130.0140.00316.49
7.4.120.0110.00516.49
7.4.110.0130.01016.63
7.4.100.0130.01016.45
7.4.90.0080.00816.52
7.4.80.0100.00719.39
7.4.70.0030.01416.48
7.4.60.0100.00716.39
7.4.50.0000.00416.36
7.4.40.0030.01322.77
7.4.30.0110.00616.57
7.4.00.0040.01114.73
7.3.330.0050.00013.20
7.3.320.0060.00013.38
7.3.310.0070.00016.41
7.3.300.0030.00316.24
7.3.290.0100.01016.38
7.3.280.0060.00916.40
7.3.270.0120.00617.40
7.3.260.0070.01016.46
7.3.250.0060.01116.47
7.3.240.0070.01016.48
7.3.230.0080.01116.42
7.3.210.0100.00716.46
7.3.200.0100.00619.39
7.3.190.0120.00616.64
7.3.180.0080.00716.48
7.3.170.0060.00916.38
7.3.160.0060.00916.32
7.3.120.0000.01514.89
7.2.330.0180.00416.85
7.2.320.0090.01216.77
7.2.310.0100.00616.89
7.2.300.0030.01416.52
7.2.290.0060.01016.50
7.2.60.0180.00716.81
7.2.00.0100.00319.05
7.1.200.0000.01515.71
7.1.100.0080.00318.38
7.1.70.0080.00017.06
7.1.60.0110.01419.82
7.1.50.0030.01216.89
7.1.00.0100.07022.40
7.0.200.0000.01016.55
7.0.140.0000.07722.11
7.0.60.0070.04020.05
7.0.50.0070.08017.91
7.0.40.0100.08020.27
7.0.30.0200.04020.15
7.0.20.0300.04320.15
7.0.10.0200.05720.09
7.0.00.0070.08320.09
5.6.280.0030.07320.79
5.6.210.0130.07320.48
5.6.200.0070.08018.16
5.6.190.0100.08320.39
5.6.180.4230.03720.43
5.6.170.0300.05320.57
5.6.160.0130.06720.44
5.6.150.0100.03718.23
5.6.140.0100.03318.15
5.6.130.0170.07318.18
5.6.120.0070.04721.04
5.6.110.0130.07721.13
5.6.100.0200.07320.99
5.6.90.0100.08721.11
5.6.80.0100.05020.29
5.6.70.0370.07020.51
5.5.350.0130.07320.38
5.5.340.0100.07017.98
5.5.330.0030.04320.43
5.5.320.0300.04320.32
5.5.310.0300.08020.32
5.5.300.0000.04317.93
5.5.290.0070.08718.09
5.5.280.0130.07320.89
5.5.270.0070.05720.88
5.5.260.0070.04020.98
5.5.250.0030.07020.79
5.5.240.0030.04320.17
5.4.450.0230.05319.60
5.4.440.0700.06019.55
5.4.430.0170.05019.46
5.4.420.0030.06019.39
5.4.410.0130.05019.35
5.4.400.0830.00018.81
5.4.390.0830.00018.79
5.4.380.0270.04718.48
5.4.370.0130.05318.61
5.4.360.0130.06318.53
5.4.350.0100.06018.54
5.4.340.0230.04318.71
5.4.320.0040.04012.52
5.4.310.0080.04312.51
5.4.300.0080.03912.51
5.4.290.0050.04012.50
5.4.280.0050.03612.40
5.4.270.0130.07018.80
5.4.260.0100.07019.09
5.4.250.0100.05318.80
5.4.240.0070.06718.98
5.4.230.0100.06718.79
5.4.220.0130.05019.00
5.4.210.0130.06018.95
5.4.200.0070.06019.10
5.4.190.0130.06318.75
5.4.180.0230.04318.75
5.4.170.0070.07718.97
5.4.160.0200.04719.07
5.4.150.0130.06718.63
5.4.140.0070.08016.61
5.4.130.0100.05716.58
5.4.120.0100.05016.63
5.4.110.0130.06316.54
5.4.100.0170.05016.53
5.4.90.0100.05016.41
5.4.80.0130.04316.59
5.4.70.0170.05016.55
5.4.60.0270.03716.50
5.4.50.0170.06016.59
5.4.40.0170.06316.45
5.4.30.0000.07016.35
5.4.20.0130.06316.63
5.4.10.0130.07316.53
5.4.00.0270.05715.90
5.3.290.0090.04112.80
5.3.280.0100.07314.69
5.3.270.0130.06014.61
5.3.260.0170.06314.80
5.3.250.0030.08014.68
5.3.240.0030.05714.71
5.3.230.0100.06014.60
5.3.220.0070.06314.57
5.3.210.0130.05714.80
5.3.200.0030.07314.67
5.3.190.0100.06314.58
5.3.180.0100.05314.74
5.3.170.0070.05314.74
5.3.160.0030.05314.48
5.3.150.0200.05714.80
5.3.140.0130.05714.47
5.3.130.0100.06314.64
5.3.120.0070.05314.65
5.3.110.0130.05314.55
5.3.100.0030.06714.13
5.3.90.0000.07014.08
5.3.80.0100.05313.94
5.3.70.0130.05314.02
5.3.60.0100.05713.98
5.3.50.0170.06714.14
5.3.40.0170.06013.87
5.3.30.0130.06014.15
5.3.20.0200.06013.87
5.3.10.0070.05313.63
5.3.00.0100.07713.73
5.2.170.0070.04711.32
5.2.160.0230.04311.25
5.2.150.0130.05711.13
5.2.140.0170.04711.24
5.2.130.0100.04011.11
5.2.120.0030.06011.07
5.2.110.0200.04711.09
5.2.100.0100.04010.94
5.2.90.0100.04711.10
5.2.80.0170.04011.21
5.2.70.0000.05311.20
5.2.60.0070.04311.16
5.2.50.0170.04711.02
5.2.40.0070.05011.18
5.2.30.0030.05011.07
5.2.20.0130.03711.05
5.2.10.0030.04010.72
5.2.00.0130.04010.90
5.1.60.0030.05010.26
5.1.50.0130.0279.94
5.1.40.0030.04310.02
5.1.30.0100.04710.43
5.1.20.0070.05010.44
5.1.10.0070.05010.33
5.1.00.0100.03310.07
5.0.50.0030.0378.61
5.0.40.0070.0278.40
5.0.30.0130.0378.08
5.0.20.0000.0308.26
5.0.10.0070.0338.23
5.0.00.0000.0578.15
4.4.90.0130.0135.96
4.4.80.0000.0305.96
4.4.70.0100.0235.96
4.4.60.0100.0175.96
4.4.50.0130.0175.96
4.4.40.0130.0405.96
4.4.30.0030.0305.96
4.4.20.0070.0235.96
4.4.10.0000.0275.96
4.4.00.0000.0475.96
4.3.110.0000.0335.96
4.3.100.0000.0305.96
4.3.90.0070.0235.96
4.3.80.0000.0435.96
4.3.70.0030.0235.96
4.3.60.0030.0205.96
4.3.50.0030.0205.96
4.3.40.0100.0275.96
4.3.30.0030.0235.96
4.3.20.0000.0235.96
4.3.10.0000.0235.96
4.3.00.0100.0206.58

preferences:
63.53 ms | 400 KiB | 5 Q