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 = array(), $out) { foreach($items as $num => $val) { if($num % 2 == 0) { $out += (string)$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.70.0090.01216.48
8.3.60.0100.01018.55
8.3.50.0080.01221.86
8.3.40.0140.00318.92
8.3.30.0120.00319.04
8.3.20.0060.00320.29
8.3.10.0040.00421.79
8.3.00.0040.00422.39
8.2.180.0100.01017.00
8.2.170.0170.00322.96
8.2.160.0110.00422.13
8.2.150.0030.00524.18
8.2.140.0060.01324.66
8.2.130.0000.00826.16
8.2.120.0060.00317.50
8.2.110.0030.00622.19
8.2.100.0090.00319.46
8.2.90.0000.00819.09
8.2.80.0050.00317.97
8.2.70.0040.00417.38
8.2.60.0040.00418.04
8.2.50.0040.00418.07
8.2.40.0030.00518.09
8.2.30.0040.00417.90
8.2.20.0040.00417.59
8.2.10.0050.00519.39
8.2.00.0090.00017.66
8.1.280.0070.01125.92
8.1.270.0000.00822.08
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0000.00923.88
8.1.230.0000.01119.21
8.1.220.0040.00417.74
8.1.210.0040.00418.77
8.1.200.0060.00317.25
8.1.190.0040.00417.43
8.1.180.0040.00418.10
8.1.170.0030.00618.54
8.1.160.0000.00721.97
8.1.150.0000.00718.61
8.1.140.0000.00817.38
8.1.130.0030.00317.83
8.1.120.0070.00017.42
8.1.110.0040.00417.25
8.1.100.0050.00317.37
8.1.90.0000.00717.31
8.1.80.0000.00717.30
8.1.70.0030.00317.38
8.1.60.0030.00617.64
8.1.50.0080.00017.56
8.1.40.0030.00517.46
8.1.30.0000.00717.50
8.1.20.0050.00317.50
8.1.10.0000.00817.51
8.1.00.0030.00617.52
8.0.300.0040.00418.77
8.0.290.0060.00316.93
8.0.280.0030.00318.40
8.0.270.0000.00717.21
8.0.260.0030.00316.83
8.0.250.0000.00717.00
8.0.240.0050.00317.02
8.0.230.0030.00616.87
8.0.220.0030.00316.91
8.0.210.0080.00016.91
8.0.200.0030.00316.91
8.0.190.0060.00316.95
8.0.180.0040.00416.84
8.0.170.0040.00416.95
8.0.160.0050.00316.94
8.0.150.0070.00016.86
8.0.140.0040.00416.76
8.0.130.0030.00613.30
8.0.120.0080.00016.87
8.0.110.0040.00416.89
8.0.100.0030.00616.92
8.0.90.0080.00016.99
8.0.80.0080.00816.93
8.0.70.0040.00416.93
8.0.60.0040.00416.94
8.0.50.0040.00416.89
8.0.30.0080.01117.08
8.0.20.0050.01417.40
8.0.10.0040.00417.04
8.0.00.0130.00716.89
7.4.330.0030.00315.00
7.4.320.0000.00716.61
7.4.300.0000.00616.53
7.4.290.0000.00816.59
7.4.280.0020.00516.41
7.4.270.0030.00316.62
7.4.260.0030.00316.53
7.4.250.0000.00816.63
7.4.240.0040.00316.53
7.4.230.0030.00316.63
7.4.220.0130.01316.48
7.4.210.0070.00916.57
7.4.200.0070.00016.72
7.4.190.0000.00816.59
7.4.160.0080.00816.62
7.4.150.0110.00817.40
7.4.140.0110.00617.86
7.4.130.0100.01116.51
7.4.120.0080.01016.50
7.4.110.0130.01016.45
7.4.100.0030.01516.69
7.4.90.0180.00016.57
7.4.80.0060.01019.39
7.4.70.0110.00616.67
7.4.60.0170.00016.59
7.4.50.0000.00716.41
7.4.40.0090.00622.77
7.4.30.0090.00916.53
7.4.00.0040.01115.15
7.3.330.0030.00313.41
7.3.320.0050.00013.21
7.3.310.0030.00316.35
7.3.300.0030.00316.26
7.3.290.0090.00916.35
7.3.280.0060.01016.36
7.3.270.0130.00317.40
7.3.260.0060.01016.33
7.3.250.0100.01216.60
7.3.240.0090.00616.29
7.3.230.0060.01116.39
7.3.210.0130.01316.63
7.3.200.0090.00919.39
7.3.190.0150.00316.42
7.3.180.0060.01016.45
7.3.170.0120.00916.31
7.3.160.0060.00916.30
7.3.120.0110.00714.96
7.3.110.0060.00714.70
7.3.100.0080.00914.70
7.3.90.0040.00914.86
7.3.80.0050.00614.74
7.3.70.0090.00414.74
7.3.60.0070.00614.91
7.3.50.0020.00914.89
7.3.40.0060.00514.77
7.3.30.0080.00914.82
7.3.20.0060.00816.57
7.3.10.0050.00916.47
7.3.00.0040.00916.59
7.2.330.0090.00916.71
7.2.320.0100.01316.31
7.2.310.0060.01616.60
7.2.300.0060.01016.41
7.2.290.0100.00716.73
7.2.250.0040.01414.97
7.2.240.0030.01315.03
7.2.230.0050.01214.97
7.2.220.0010.01314.80
7.2.210.0050.00715.13
7.2.200.0060.00614.82
7.2.190.0050.01214.94
7.2.180.0060.01014.96
7.2.170.0050.00914.96
7.2.160.0090.00714.96
7.2.150.0090.00716.68
7.2.140.0050.01116.91
7.2.130.0060.00916.67
7.2.120.0090.00816.91
7.2.110.0030.00916.81
7.2.100.0030.01016.78
7.2.90.0060.00816.89
7.2.80.0070.00716.87
7.2.70.0040.00916.93
7.2.60.0060.00816.72
7.2.50.0040.00716.84
7.2.40.0110.00416.95
7.2.30.0070.00816.84
7.2.20.0090.00616.64
7.2.10.0100.00516.70
7.2.00.0080.00617.27
7.1.330.0070.00515.63
7.1.320.0060.00815.74
7.1.310.0080.00415.59
7.1.300.0080.00715.62
7.1.290.0060.00715.69
7.1.280.0040.00815.73
7.1.270.0050.00715.49
7.1.260.0050.00815.68
7.1.250.0060.00915.79
7.1.240.0100.00315.74
7.1.230.0030.00915.49
7.1.220.0030.01315.75
7.1.210.0110.00015.77
7.1.200.0080.00615.78
7.1.190.0070.00415.42
7.1.180.0000.01315.83
7.1.170.0000.01515.78
7.1.160.0100.00315.60
7.1.150.0000.01115.44
7.1.140.0030.00515.83
7.1.130.0040.01115.73
7.1.120.0000.01415.61
7.1.110.0040.01115.82
7.1.100.0040.00616.84
7.1.90.0030.00915.52
7.1.80.0070.00415.70
7.1.70.0070.00516.21
7.1.60.0060.01117.68
7.1.50.0060.00616.36
7.1.40.0070.00415.85
7.1.30.0030.00915.73
7.1.20.0030.00615.75
7.1.10.0000.01415.79
7.1.00.0070.03919.08
7.0.330.0070.00715.37
7.0.320.0070.00715.36
7.0.310.0030.00615.45
7.0.300.0070.00715.39
7.0.290.0030.01315.46
7.0.280.0030.01015.11
7.0.270.0030.00715.45
7.0.260.0070.00715.41
7.0.250.0060.00315.46
7.0.240.0030.00915.45
7.0.230.0060.00615.59
7.0.220.0000.01515.60
7.0.210.0040.00415.55
7.0.200.0050.00515.99
7.0.190.0090.00315.31
7.0.180.0040.00715.52
7.0.170.0090.00315.16
7.0.160.0030.01015.28
7.0.150.0000.01615.22
7.0.140.0070.04018.84
7.0.130.0030.00715.42
7.0.120.0040.01215.52
7.0.110.0030.00915.59
7.0.100.0030.00615.41
7.0.90.0060.00615.25
7.0.80.0030.00915.38
7.0.70.0060.01115.56
7.0.60.0040.02417.50
7.0.50.0100.02616.73
7.0.40.0050.04816.90
7.0.30.0300.04016.77
7.0.20.0080.05016.95
7.0.10.0100.03316.85
7.0.00.0070.04416.68
5.6.400.0080.00814.32
5.6.390.0040.00414.59
5.6.380.0070.00714.57
5.6.370.0060.00314.18
5.6.360.0070.00714.78
5.6.350.0080.00314.75
5.6.340.0040.01114.72
5.6.330.0070.00714.68
5.6.320.0070.01014.50
5.6.310.0060.00314.51
5.6.300.0030.01414.43
5.6.290.0100.00314.36
5.6.280.0030.04217.80
5.6.270.0040.01514.57
5.6.260.0000.01714.37
5.6.250.0000.01014.46
5.6.240.0040.01114.59
5.6.230.0060.00914.46
5.6.220.0070.01014.73
5.6.210.0030.02717.64
5.6.200.0070.03216.38
5.6.190.0030.05017.42
5.6.180.0150.02217.45
5.6.170.0170.02217.44
5.6.160.0040.02817.46
5.6.150.0080.02116.26
5.6.140.0110.03416.30
5.6.130.0020.02816.44
5.6.120.0080.03517.62
5.6.110.0050.04217.69
5.6.100.0070.02317.71
5.6.90.0110.04317.54
5.6.80.0080.03717.34
5.6.70.2300.02217.30
5.6.60.0120.00314.24
5.6.50.0070.00714.49
5.6.40.0040.00814.13
5.6.30.0070.01014.24
5.6.20.0100.00714.27
5.6.10.0000.00914.14
5.6.00.0060.00914.35
5.5.380.0040.00814.52
5.5.370.0000.01814.34
5.5.360.0090.00914.48
5.5.350.0050.02317.33
5.5.340.0040.03816.27
5.5.330.0050.04217.22
5.5.320.0160.02417.28
5.5.310.0180.03017.34
5.5.300.0050.03316.06
5.5.290.0050.04616.12
5.5.280.0070.04717.68
5.5.270.0080.03317.67
5.5.260.0110.04017.59
5.5.250.0080.04617.49
5.5.240.0070.03117.35
5.5.230.0060.01214.47
5.5.220.0120.00314.48
5.5.210.0070.00414.59
5.5.200.0000.01414.43
5.5.190.0000.01514.13
5.5.180.0060.00314.45
5.5.170.0080.00414.52
5.5.160.0070.00314.34
5.5.150.0030.01214.36
5.5.140.0030.01014.27
5.5.130.0070.00314.09
5.5.120.0070.00714.42
5.5.110.0030.00914.39
5.5.100.0000.01514.36
5.5.90.0090.00613.97
5.5.80.0090.00614.18
5.5.70.0050.00814.10
5.5.60.0000.01414.18
5.5.50.0040.01214.48
5.5.40.0060.00314.43
5.5.30.0070.00714.20
5.5.20.0060.00314.43
5.5.10.0040.01114.21
5.5.00.0060.00314.43
5.4.450.0050.03515.99
5.4.440.0480.02815.97
5.4.430.0080.02815.89
5.4.420.0030.04515.99
5.4.410.0140.03715.84
5.4.400.0750.00115.57
5.4.390.0700.00315.58
5.4.380.0180.02715.46
5.4.370.0020.03815.43
5.4.360.0110.02815.60
5.4.350.0130.02815.50
5.4.340.0150.02315.54
5.4.330.0030.00312.37
5.4.320.0050.02212.44
5.4.310.0060.02312.44
5.4.300.0060.02112.45
5.4.290.0060.02112.44
5.4.280.0060.02112.39
5.4.270.0120.02515.69
5.4.260.0090.04115.51
5.4.250.0070.04115.69
5.4.240.0100.03015.65
5.4.230.0050.02915.56
5.4.220.0080.04015.70
5.4.210.0080.03115.65
5.4.200.0050.03915.65
5.4.190.0100.03615.73
5.4.180.0070.02815.55
5.4.170.0170.02515.66
5.4.160.0100.02415.65
5.4.150.0070.04015.56
5.4.140.0040.03014.51
5.4.130.0080.02814.45
5.4.120.0070.03714.43
5.4.110.0080.03414.45
5.4.100.0200.02314.37
5.4.90.0060.02414.40
5.4.80.0020.03114.48
5.4.70.0000.03714.40
5.4.60.0090.03314.50
5.4.50.0050.03014.34
5.4.40.0070.03214.43
5.4.30.0030.03514.46
5.4.20.0050.03814.43
5.4.10.0050.02814.43
5.4.00.0070.03514.19
5.3.290.0050.02212.58
5.3.280.0060.03113.49
5.3.270.0070.04013.49
5.3.260.0060.02813.48
5.3.250.0030.03213.49
5.3.240.0060.03113.48
5.3.230.0050.03313.58
5.3.220.0070.02613.43
5.3.210.0140.03213.52
5.3.200.0140.03413.47
5.3.190.0020.03513.53
5.3.180.0040.03713.56
5.3.170.0100.02013.46
5.3.160.0050.03813.59
5.3.150.0020.03213.49
5.3.140.0000.03413.47
5.3.130.0050.02813.54
5.3.120.0060.02813.51
5.3.110.0060.02813.52
5.3.100.0130.03113.26
5.3.90.0110.02513.24
5.3.80.0050.03813.29
5.3.70.0020.03013.29
5.3.60.0030.03313.19
5.3.50.0030.03513.12
5.3.40.0000.03513.18
5.3.30.0080.03313.13
5.3.20.0070.02513.08
5.3.10.0050.03013.05
5.3.00.0130.02813.05
5.2.170.0170.04711.24
5.2.160.0030.04311.25
5.2.150.0070.04311.35
5.2.140.0030.04311.34
5.2.130.0000.05311.03
5.2.120.0070.05311.32
5.2.110.0030.04711.08
5.2.100.0130.03311.03
5.2.90.0030.04711.28
5.2.80.0000.05011.29
5.2.70.0000.04711.18
5.2.60.0130.05011.03
5.2.50.0130.03311.12
5.2.40.0030.05311.10
5.2.30.0070.04710.97
5.2.20.0030.05311.07
5.2.10.0000.04310.97
5.2.00.0070.03710.91
5.1.60.0030.05010.11
5.1.50.0070.03310.00
5.1.40.0000.05310.01
5.1.30.0070.03310.52
5.1.20.0070.05010.39
5.1.10.0030.03310.07
5.1.00.0100.03310.25
5.0.50.0030.0408.64
5.0.40.0030.0308.48
5.0.30.0000.0578.45
5.0.20.0030.0338.14
5.0.10.0030.0408.27
5.0.00.0030.0538.39
4.4.90.0070.0205.85
4.4.80.0070.0275.83
4.4.70.0000.0235.90
4.4.60.0030.0275.85
4.4.50.0070.0175.83
4.4.40.0030.0375.98
4.4.30.0030.0275.86
4.4.20.0070.0235.88
4.4.10.0030.0235.91
4.4.00.0030.0335.85
4.3.110.0000.0275.78
4.3.100.0030.0235.89
4.3.90.0030.0205.88
4.3.80.0100.0335.88
4.3.70.0070.0275.88
4.3.60.0000.0235.88
4.3.50.0000.0305.88
4.3.40.0000.0435.88
4.3.30.0000.0235.88
4.3.20.0030.0235.88
4.3.10.0000.0305.88
4.3.00.0130.0236.54

preferences:
55 ms | 401 KiB | 5 Q