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 += $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.0070.01418.43
8.3.50.0110.00921.99
8.3.40.0070.01118.96
8.3.30.0150.00019.05
8.3.20.0030.00520.29
8.3.10.0040.00422.09
8.3.00.0080.00022.52
8.2.180.0120.00916.63
8.2.170.0110.00422.96
8.2.160.0170.00022.09
8.2.150.0080.00024.18
8.2.140.0090.00024.66
8.2.130.0080.00026.16
8.2.120.0070.00317.38
8.2.110.0090.00022.20
8.2.100.0080.00419.63
8.2.90.0080.00019.14
8.2.80.0050.00318.16
8.2.70.0040.00417.75
8.2.60.0050.00318.05
8.2.50.0000.00818.07
8.2.40.0040.00418.22
8.2.30.0050.00318.16
8.2.20.0030.00517.81
8.2.10.0030.00519.65
8.2.00.0080.00019.59
8.1.280.0120.00325.92
8.1.270.0040.00423.99
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0080.00023.67
8.1.230.0040.00719.11
8.1.220.0000.00817.77
8.1.210.0080.00018.77
8.1.200.0030.00717.35
8.1.190.0040.00417.53
8.1.180.0050.00318.10
8.1.170.0000.00918.53
8.1.160.0040.00422.00
8.1.150.0040.00418.62
8.1.140.0000.00717.40
8.1.130.0000.00717.85
8.1.120.0040.00417.50
8.1.110.0040.00417.47
8.1.100.0050.00217.52
8.1.90.0040.00417.43
8.1.80.0080.00017.45
8.1.70.0000.00717.39
8.1.60.0030.00517.61
8.1.50.0000.00817.52
8.1.40.0040.00417.51
8.1.30.0000.00717.56
8.1.20.0090.00017.74
8.1.10.0040.00417.50
8.1.00.0030.00617.55
8.0.300.0040.00418.77
8.0.290.0040.00417.05
8.0.280.0030.00318.51
8.0.270.0000.00717.32
8.0.260.0080.00016.92
8.0.250.0000.00717.02
8.0.240.0030.00516.93
8.0.230.0070.00017.07
8.0.220.0000.00716.92
8.0.210.0030.00316.94
8.0.200.0030.00316.93
8.0.190.0040.00417.04
8.0.180.0030.00317.05
8.0.170.0040.00417.00
8.0.160.0000.00817.02
8.0.150.0000.00716.93
8.0.140.0040.00416.93
8.0.130.0000.00513.48
8.0.120.0000.00716.85
8.0.110.0000.00816.81
8.0.100.0040.00416.89
8.0.90.0000.00716.88
8.0.80.0110.00617.04
8.0.70.0000.00717.01
8.0.60.0040.00317.01
8.0.50.0040.00416.81
8.0.30.0060.01216.98
8.0.20.0160.00317.40
8.0.10.0050.00217.14
8.0.00.0100.01216.64
7.4.330.0040.00415.00
7.4.320.0000.00616.58
7.4.300.0030.00316.45
7.4.290.0030.00616.62
7.4.280.0000.00716.64
7.4.270.0040.00416.38
7.4.260.0070.00316.46
7.4.250.0040.00416.46
7.4.240.0060.00116.62
7.4.230.0030.00316.68
7.4.220.0110.00716.73
7.4.210.0090.01016.58
7.4.200.0000.00716.65
7.4.190.0070.00016.70
7.4.160.0040.01216.44
7.4.150.0160.00917.40
7.4.140.0090.01017.86
7.4.130.0090.00916.54
7.4.120.0070.01216.59
7.4.110.0150.00916.57
7.4.100.0080.01416.65
7.4.90.0100.01016.75
7.4.80.0150.00419.39
7.4.70.0110.01216.49
7.4.60.0090.00916.53
7.4.50.0050.00316.54
7.4.40.0090.00922.77
7.4.30.0060.01216.40
7.4.00.0110.00714.85
7.3.330.0030.00313.31
7.3.320.0000.00513.45
7.3.310.0040.00416.48
7.3.300.0030.00316.46
7.3.290.0160.00316.43
7.3.280.0080.00716.47
7.3.270.0100.00717.40
7.3.260.0110.00916.77
7.3.250.0120.01116.49
7.3.240.0130.00516.63
7.3.230.0140.00316.61
7.3.210.0100.00716.44
7.3.200.0080.00819.39
7.3.190.0080.01116.73
7.3.180.0130.00316.53
7.3.170.0060.01016.52
7.3.160.0050.01116.47
7.3.120.0080.00514.90
7.3.110.0040.01114.68
7.3.100.0060.00914.84
7.3.90.0150.00015.07
7.3.80.0030.00714.86
7.3.70.0060.00614.86
7.3.60.0140.00014.95
7.3.50.0030.00714.91
7.3.40.0060.00614.90
7.3.30.0000.00814.94
7.3.20.0030.00716.26
7.3.10.0090.00916.39
7.3.00.0090.00716.59
7.2.330.0040.01616.60
7.2.320.0130.00916.76
7.2.310.0100.00716.70
7.2.300.0060.01216.49
7.2.290.0060.01216.64
7.2.240.0060.00915.12
7.2.230.0090.00615.17
7.2.220.0110.00414.70
7.2.210.0110.00414.96
7.2.200.0000.01114.80
7.2.190.0000.01614.86
7.2.180.0080.00815.11
7.2.170.0080.00714.85
7.2.160.0100.00315.14
7.2.150.0060.00917.02
7.2.140.0030.00916.93
7.2.130.0080.00816.79
7.2.120.0090.00516.80
7.2.110.0050.00816.45
7.2.100.0060.00716.74
7.2.90.0100.00316.74
7.2.80.0060.01016.74
7.2.70.0050.00916.79
7.2.60.0110.00416.82
7.2.50.0110.00616.66
7.2.40.0070.01116.79
7.2.30.0080.00716.84
7.2.20.0150.00716.78
7.2.10.0070.01116.59
7.2.00.0080.00717.38
7.1.330.0070.00715.48
7.1.320.0000.01515.70
7.1.310.0030.00615.90
7.1.300.0070.01015.76
7.1.290.0040.00815.76
7.1.280.0060.00915.68
7.1.270.0040.01215.80
7.1.260.0070.01015.49
7.1.250.0070.01215.71
7.1.240.0030.01015.86
7.1.230.0040.00715.80
7.1.220.0040.00915.82
7.1.210.0030.01415.54
7.1.200.0040.01115.84
7.1.190.0060.00615.95
7.1.180.0070.00715.96
7.1.170.0000.01515.81
7.1.160.0060.00615.68
7.1.150.0140.00315.94
7.1.140.0110.00415.78
7.1.130.0120.00015.82
7.1.120.0100.00615.50
7.1.110.0030.01015.95
7.1.100.0050.00816.98
7.1.90.0070.00715.90
7.1.80.0070.00715.69
7.1.70.0020.00916.41
7.1.60.0090.00917.81
7.1.50.0130.00416.45
7.1.40.0040.01115.76
7.1.30.0030.00715.74
7.1.20.0000.01015.89
7.1.10.0130.00015.93
7.1.00.0030.04019.05
7.0.320.0040.01115.26
7.0.310.0040.00815.44
7.0.300.0110.00315.53
7.0.290.0090.00015.67
7.0.280.0110.00315.45
7.0.270.0060.00915.26
7.0.260.0070.00715.18
7.0.250.0060.00915.45
7.0.240.0000.01415.60
7.0.230.0070.00015.47
7.0.220.0100.00615.59
7.0.210.0130.00015.28
7.0.200.0030.00716.09
7.0.190.0080.00815.39
7.0.180.0110.00315.29
7.0.170.0060.00615.52
7.0.160.0000.01515.18
7.0.150.0040.00915.14
7.0.140.0080.03618.68
7.0.130.0060.00715.39
7.0.120.0130.00015.58
7.0.110.0030.00715.58
7.0.100.0000.00815.28
7.0.90.0110.00015.57
7.0.80.0000.01415.19
7.0.70.0040.00415.56
7.0.60.0080.03117.58
7.0.50.0040.04616.72
7.0.40.0020.05116.92
7.0.30.0140.02416.91
7.0.20.0130.03816.83
7.0.10.0030.02516.84
7.0.00.0020.05016.84
5.6.380.0110.00314.80
5.6.370.0000.01014.67
5.6.360.0030.01014.57
5.6.350.0070.00714.23
5.6.340.0070.00714.54
5.6.330.0070.00714.29
5.6.320.0040.01114.34
5.6.310.0070.00314.73
5.6.300.0100.00314.26
5.6.290.0000.01414.77
5.6.280.0070.03517.78
5.6.270.0060.00314.40
5.6.260.0060.00914.26
5.6.250.0140.00014.72
5.6.240.0090.00314.31
5.6.230.0000.01014.38
5.6.220.0090.00314.28
5.6.210.0080.03317.54
5.6.200.0030.02516.38
5.6.190.0040.04217.44
5.6.180.0160.04317.41
5.6.170.0130.04517.50
5.6.160.0050.03517.49
5.6.150.0050.02316.22
5.6.140.0060.02016.25
5.6.130.0070.04016.35
5.6.120.0070.03017.86
5.6.110.0020.05117.88
5.6.100.0120.04017.56
5.6.90.0050.02717.79
5.6.80.0020.05217.34
5.6.70.0100.00314.23
5.6.60.0070.00714.35
5.6.50.0100.00414.49
5.6.40.0090.00614.27
5.6.30.0090.00314.23
5.6.20.0070.00614.41
5.6.10.0070.01014.44
5.6.00.0040.00814.11
5.5.380.0030.00511.43
5.5.370.0030.00711.23
5.5.360.0000.00811.00
5.5.350.0110.04015.83
5.5.340.0080.04114.48
5.5.330.0050.02715.78
5.5.320.0120.04415.79
5.5.310.0150.04015.82
5.5.300.0030.02814.49
5.5.290.0050.02214.79
5.5.280.0080.04016.20
5.5.270.0050.02815.95
5.5.260.0150.03716.05
5.5.250.0080.04115.98
5.5.240.0080.03315.81
5.5.230.0070.00411.43
5.5.220.0000.01011.27
5.5.210.0090.00311.36
5.5.200.0000.00611.03
5.5.190.0040.00811.00
5.5.180.0070.00311.32
5.5.170.0080.00814.52
5.5.160.0000.01111.06
5.5.150.0000.01011.40
5.5.140.0030.00611.16
5.5.130.0040.00411.16
5.5.120.0000.00611.42
5.5.110.0080.00311.07
5.5.100.0000.00711.13
5.5.90.0060.00311.13
5.5.80.0060.00011.38
5.5.70.0060.00611.30
5.5.60.0000.00711.36
5.5.50.0070.00311.22
5.5.40.0040.00811.04
5.5.30.0080.00311.11
5.5.20.0000.01210.84
5.5.10.0040.00411.14
5.5.00.0030.00611.38
5.4.450.0330.02515.39
5.4.440.0370.02815.41
5.4.430.0370.02215.34
5.4.420.0480.02015.32
5.4.410.0280.02115.12
5.4.400.0540.01715.12
5.4.390.0250.03815.15
5.4.380.0180.03014.93
5.4.370.0250.02014.90
5.4.360.0160.03114.88
5.4.350.0200.04014.79
5.4.340.0250.02914.82
5.4.330.0090.00311.30
5.4.320.0060.01911.80
5.4.310.0060.02211.97
5.4.300.0040.02311.86
5.4.290.0060.02811.90
5.4.280.0060.02111.73
5.4.270.0080.02814.96
5.4.260.0100.03015.12
5.4.250.0150.03314.86
5.4.240.0080.03115.03
5.4.230.0020.03515.03
5.4.220.0060.04514.75
5.4.210.0080.02815.06
5.4.200.0140.02814.95
5.4.190.0060.03315.09
5.4.180.0070.04014.99
5.4.170.0050.03714.99
5.4.160.0080.04114.96
5.4.150.0080.02915.12
5.4.140.0080.03713.74
5.4.130.0050.03613.92
5.4.120.0020.04213.76
5.4.110.0070.03314.09
5.4.100.0090.02613.73
5.4.90.0050.03013.67
5.4.80.0070.03213.67
5.4.70.0130.03213.79
5.4.60.0080.03313.66
5.4.50.0100.02813.75
5.4.40.0040.04213.90
5.4.30.0000.03413.77
5.4.20.0080.03513.81
5.4.10.0050.03613.86
5.4.00.0030.03113.55
5.3.290.0040.02311.79
5.3.280.0050.03012.65
5.3.270.0100.02912.55
5.3.260.0100.03712.63
5.3.250.0020.03412.77
5.3.240.0080.03812.51
5.3.230.0080.03612.58
5.3.220.0080.03512.61
5.3.210.0090.02712.55
5.3.200.0100.02812.61
5.3.190.0080.02512.62
5.3.180.0100.03012.69
5.3.170.0120.02212.57
5.3.160.0110.03212.74
5.3.150.0100.03312.66
5.3.140.0120.03412.60
5.3.130.0120.03912.71
5.3.120.0030.03212.60
5.3.110.0070.03512.53
5.3.100.0080.02812.41
5.3.90.0060.02712.38
5.3.80.0060.03812.36
5.3.70.0070.02812.41
5.3.60.0060.02812.33
5.3.50.0060.03312.16
5.3.40.0060.02812.24
5.3.30.0100.03412.35
5.3.20.0020.03212.20
5.3.10.0080.02611.97
5.3.00.0080.03512.03
5.2.170.0020.02710.58
5.2.160.0080.02810.59
5.2.150.0030.03310.55
5.2.140.0030.03310.49
5.2.130.0070.03210.52
5.2.120.0030.02610.52
5.2.110.0050.02810.59
5.2.100.0030.02510.53
5.2.90.0060.02110.52
5.2.80.0060.03010.52
5.2.70.0030.03210.52
5.2.60.0050.02310.54
5.2.50.0050.02210.45
5.2.40.0070.02810.38
5.2.30.0000.03110.39
5.2.20.0020.02510.49
5.2.10.0070.02010.35
5.2.00.0020.02510.29
5.1.60.0020.0229.96
5.1.50.0030.02710.01
5.1.40.0040.0189.94
5.1.30.0070.02510.18
5.1.20.0040.02210.06
5.1.10.0060.0219.95
5.1.00.0030.02610.01
5.0.50.0100.0159.20
5.0.40.0060.0189.14
5.0.30.0020.0309.17
5.0.20.0070.0159.03
5.0.10.0020.0208.94
5.0.00.0030.0238.97
4.4.90.0030.0137.93
4.4.80.0050.0107.93
4.4.70.0050.0117.93
4.4.60.0100.0087.93
4.4.50.0020.0187.93
4.4.40.0070.0207.93
4.4.30.0020.0187.93
4.4.20.0030.0137.93
4.4.10.0020.0157.93
4.4.00.0080.0147.93
4.3.110.0030.0147.93
4.3.100.0020.0137.93
4.3.90.0040.0157.93
4.3.80.0030.0237.93
4.3.70.0050.0137.93
4.3.60.0080.0157.93
4.3.50.0030.0157.93
4.3.40.0050.0227.93
4.3.30.0030.0137.93
4.3.20.0020.0157.93
4.3.10.0030.0157.93
4.3.00.0070.01212.70

preferences:
36.79 ms | 401 KiB | 5 Q