3v4l.org

run code in 300+ PHP versions simultaneously
<?php class testCase { private $stores; /* $out not having default value so type not inferred */ /* names very vague */ public function doFunction($items = array(), $out ) { foreach($items as $num => $val) { /* lots of overriding of output here, seems like += or concat */ 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 ANYWAY? */ //$out = "<br />"; } return $this->store = $out; } /* PRIVATE, SO NOT ACCESSIBLE! FIX: make public */ /* name is vague */ 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 { public $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; } public function unFunction($items = '', $out = array()) { $items = implode("<br />", $items); foreach($items as $num => $val) { if($num % 2 !== 0) { $out[$num] = $val; } else { $out[$num] = strtlower($val); } } echo $out; } } $test = new testCase1(); $test->doFunction(array_merge(range(0,25), range('a','z'))) . "<hr />"; echo $test->stores; //print_r($test -> unFunction($test->stores)); //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.55
8.3.50.0130.00722.03
8.3.40.0120.00318.84
8.3.30.0100.00319.03
8.3.20.0000.00820.34
8.3.10.0080.00022.09
8.3.00.0050.00322.34
8.2.180.0150.00316.75
8.2.170.0220.00022.96
8.2.160.0100.00722.20
8.2.150.0080.00024.18
8.2.140.0120.00324.66
8.2.130.0060.00326.16
8.2.120.0040.00419.23
8.2.110.0030.00622.27
8.2.100.0090.00319.57
8.2.90.0040.00419.22
8.2.80.0080.00018.16
8.2.70.0040.00417.75
8.2.60.0040.00418.03
8.2.50.0030.00618.07
8.2.40.0070.00018.16
8.2.30.0040.00418.07
8.2.20.0080.00017.74
8.2.10.0000.00819.46
8.2.00.0030.00617.77
8.1.280.0030.01025.92
8.1.270.0050.00322.15
8.1.260.0100.00026.35
8.1.250.0080.00028.09
8.1.240.0090.00024.02
8.1.230.0040.00719.16
8.1.220.0000.00817.74
8.1.210.0080.00018.77
8.1.200.0100.00017.36
8.1.190.0000.00817.63
8.1.180.0030.00518.10
8.1.170.0060.00318.59
8.1.160.0040.00421.96
8.1.150.0030.00618.63
8.1.140.0000.00817.53
8.1.130.0000.00717.85
8.1.120.0040.00417.50
8.1.110.0040.00417.40
8.1.100.0000.00817.47
8.1.90.0000.00817.49
8.1.80.0070.00017.38
8.1.70.0050.00317.47
8.1.60.0040.00417.62
8.1.50.0070.00017.54
8.1.40.0040.00417.54
8.1.30.0030.00617.65
8.1.20.0030.00517.64
8.1.10.0030.00517.59
8.1.00.0000.00817.44
8.0.300.0080.00018.77
8.0.290.0070.00017.18
8.0.280.0030.00318.43
8.0.270.0040.00417.30
8.0.260.0000.00616.87
8.0.250.0070.00017.13
8.0.240.0040.00416.95
8.0.230.0050.00217.00
8.0.220.0080.00017.02
8.0.210.0030.00316.93
8.0.200.0000.00716.94
8.0.190.0060.00317.11
8.0.180.0000.00716.94
8.0.170.0050.00317.03
8.0.160.0090.00017.03
8.0.150.0040.00316.89
8.0.140.0040.00416.91
8.0.130.0040.00413.36
8.0.120.0000.00816.93
8.0.110.0040.00416.98
8.0.100.0000.00716.82
8.0.90.0050.00316.98
8.0.80.0170.00316.97
8.0.70.0040.00416.85
8.0.60.0070.00016.87
8.0.50.0000.00816.77
8.0.30.0090.00917.31
8.0.20.0120.00717.40
8.0.10.0040.00416.99
8.0.00.0080.01116.82
7.4.330.0000.00615.20
7.4.320.0030.00316.53
7.4.300.0030.00316.70
7.4.290.0030.00616.65
7.4.280.0040.00416.61
7.4.270.0000.00716.57
7.4.260.0050.00516.54
7.4.250.0000.00816.61
7.4.240.0060.00116.53
7.4.230.0000.00716.46
7.4.220.0090.00916.72
7.4.210.0050.01116.54
7.4.200.0030.00316.74
7.4.190.0070.00016.69
7.4.160.0050.01116.52
7.4.150.0120.01317.40
7.4.140.0120.00617.86
7.4.130.0110.01016.52
7.4.120.0060.01116.72
7.4.110.0120.00416.54
7.4.100.0150.00316.56
7.4.90.0130.00316.81
7.4.80.0110.00719.39
7.4.70.0110.00616.44
7.4.60.0080.00816.48
7.4.50.0000.00816.61
7.4.40.0090.00922.77
7.4.30.0130.00316.61
7.4.10.0060.01315.16
7.4.00.0050.00915.02
7.3.330.0000.00613.20
7.3.320.0030.00313.26
7.3.310.0070.00016.29
7.3.300.0050.00216.38
7.3.290.0040.01516.45
7.3.280.0100.00716.39
7.3.270.0090.00917.40
7.3.260.0090.00916.42
7.3.250.0110.00816.42
7.3.240.0110.00516.75
7.3.230.0060.01016.40
7.3.210.0140.00316.69
7.3.200.0100.00719.39
7.3.190.0060.01216.78
7.3.180.0040.01116.73
7.3.170.0130.00316.35
7.3.160.0100.00616.55
7.3.130.0090.00614.96
7.3.120.0050.01014.85
7.3.110.0130.00614.58
7.3.100.0160.00014.90
7.3.90.0080.00814.94
7.3.80.0070.00414.84
7.3.70.0080.00014.82
7.3.60.0000.00914.81
7.3.50.0060.00915.02
7.3.40.0070.01014.98
7.3.30.0030.00914.98
7.3.20.0000.01416.70
7.3.10.0050.00516.73
7.3.00.0070.01116.58
7.2.330.0100.01016.65
7.2.320.0060.01216.73
7.2.310.0030.01416.78
7.2.300.0090.00916.61
7.2.290.0110.00516.83
7.2.260.0000.01915.37
7.2.250.0000.01715.29
7.2.240.0150.00315.26
7.2.230.0070.01014.77
7.2.220.0030.01315.36
7.2.210.0060.01515.27
7.2.200.0040.01115.05
7.2.190.0030.01415.08
7.2.180.0030.01614.80
7.2.170.0030.00815.04
7.2.160.0090.00315.16
7.2.150.0040.01216.96
7.2.140.0070.00717.08
7.2.130.0000.01117.05
7.2.120.0070.01017.04
7.2.110.0100.00616.61
7.2.100.0070.00716.92
7.2.90.0110.00417.13
7.2.80.0030.01216.83
7.2.70.0030.00717.00
7.2.60.0000.01716.79
7.2.50.0070.00716.83
7.2.40.0030.01316.98
7.2.30.0120.00617.04
7.2.20.0040.01117.05
7.2.10.0130.00316.78
7.2.00.0020.01118.16
7.1.330.0060.00615.89
7.1.320.0060.00915.79
7.1.310.0090.00315.94
7.1.300.0060.01015.89
7.1.290.0120.00615.58
7.1.280.0040.01115.84
7.1.270.0080.00415.44
7.1.260.0100.00615.80
7.1.250.0050.00315.83
7.1.240.0070.00415.56
7.1.230.0040.00715.55
7.1.220.0040.00715.78
7.1.210.0030.01215.77
7.1.200.0040.01415.94
7.1.190.0090.00315.87
7.1.180.0070.00415.95
7.1.170.0040.01115.84
7.1.160.0070.00715.91
7.1.150.0100.00016.02
7.1.140.0030.00515.98
7.1.130.0040.00415.95
7.1.120.0080.00015.60
7.1.110.0040.00816.00
7.1.100.0020.01116.90
7.1.90.0030.00915.80
7.1.80.0060.00615.67
7.1.70.0060.00416.51
7.1.60.0090.00817.79
7.1.50.0100.01016.20
7.1.40.0000.00915.34
7.1.30.0090.00315.77
7.1.20.0060.00315.76
7.1.10.0090.00615.56
7.1.00.0050.04019.17
7.0.330.0080.00615.34
7.0.320.0020.01015.50
7.0.310.0070.00415.41
7.0.300.0070.00715.46
7.0.290.0030.01015.15
7.0.280.0060.00615.21
7.0.270.0040.00415.30
7.0.260.0030.00915.20
7.0.250.0060.00615.45
7.0.240.0060.00315.64
7.0.230.0120.00315.63
7.0.220.0000.00915.48
7.0.210.0000.00915.40
7.0.200.0070.00516.02
7.0.190.0080.00615.53
7.0.180.0070.00715.52
7.0.170.0040.00715.68
7.0.160.0060.00615.50
7.0.150.0060.00815.25
7.0.140.0030.03918.61
7.0.130.0000.01115.50
7.0.120.0070.00715.52
7.0.110.0040.00415.44
7.0.100.0070.00715.45
7.0.90.0060.00315.55
7.0.80.0000.00815.39
7.0.70.0070.00715.55
7.0.60.0040.02217.71
7.0.50.0080.04216.69
7.0.40.0060.02116.83
7.0.30.0200.04316.87
7.0.20.0200.03016.79
7.0.10.0230.04016.87
7.0.00.0090.02116.91
5.6.400.0100.00714.61
5.6.390.0090.00614.12
5.6.380.0060.00914.71
5.6.370.0000.00914.39
5.6.360.0030.01414.20
5.6.350.0030.01414.39
5.6.340.0130.00314.59
5.6.330.0040.00814.18
5.6.320.0080.00314.30
5.6.310.0070.00414.54
5.6.300.0020.01214.45
5.6.290.0040.00814.71
5.6.280.0090.03517.81
5.6.270.0090.00314.41
5.6.260.0030.00514.17
5.6.250.0040.01114.23
5.6.240.0080.00714.44
5.6.230.0070.00714.41
5.6.220.0030.01314.52
5.6.210.0030.04417.54
5.6.200.0050.03316.24
5.6.190.0060.04617.42
5.6.180.1980.02017.57
5.6.170.0120.02217.61
5.6.160.0050.03117.30
5.6.150.0120.04316.36
5.6.140.0070.04316.24
5.6.130.0040.03016.20
5.6.120.0050.04117.87
5.6.110.0130.01617.62
5.6.100.0060.04517.86
5.6.90.0080.04517.74
5.6.80.0080.03217.33
5.6.70.0140.04817.39
5.6.60.0070.01014.29
5.6.50.0070.00714.39
5.6.40.0130.00014.41
5.6.30.0080.00814.24
5.6.20.0040.01114.26
5.6.10.0070.01014.16
5.6.00.0120.00614.28
5.5.380.0040.01014.46
5.5.370.0030.00614.59
5.5.360.0030.00614.47
5.5.350.0020.04717.23
5.5.340.0060.04816.08
5.5.330.0070.04517.18
5.5.320.0130.04617.29
5.5.310.0170.04517.12
5.5.300.0120.03816.12
5.5.290.0120.04016.12
5.5.280.0110.04017.52
5.5.270.0030.03317.54
5.5.260.0060.04317.63
5.5.250.0070.03017.46
5.5.240.0030.03417.14
5.5.230.0000.00914.20
5.5.220.0060.00914.38
5.5.210.0000.01014.05
5.5.200.0070.00714.00
5.5.190.0030.01014.05
5.5.180.0000.01714.14
5.5.170.0070.00714.07
5.5.160.0030.01014.45
5.5.150.0100.00314.24
5.5.140.0040.00814.55
5.5.130.0030.01014.36
5.5.120.0080.00414.02
5.5.110.0000.01214.41
5.5.100.0000.00814.28
5.5.90.0080.00014.19
5.5.80.0040.00914.37
5.5.70.0060.00313.93
5.5.60.0030.00714.15
5.5.50.0000.01314.14
5.5.40.0070.00414.53
5.5.30.0070.00414.51
5.5.20.0040.01114.41
5.5.10.0040.00714.12
5.5.00.0030.00614.47
5.4.450.1000.02715.28
5.4.440.1000.02215.09
5.4.430.0940.02115.10
5.4.420.0980.02215.10
5.4.410.1010.02115.22
5.4.400.1030.02015.21
5.4.390.1050.01515.01
5.4.380.1130.01514.81
5.4.370.0820.02615.09
5.4.360.1000.02515.06
5.4.350.1000.02015.22
5.4.340.0970.02314.83
5.4.330.0030.00811.12
5.4.320.1100.02914.94
5.4.310.1100.02615.11
5.4.300.1030.02214.80
5.4.290.0970.02015.00
5.4.280.1080.02014.82
5.4.270.0980.01714.90
5.4.260.1150.02315.08
5.4.250.1180.01815.21
5.4.240.0670.02915.14
5.4.230.0070.03715.04
5.4.220.0100.03714.97
5.4.210.0820.02315.06
5.4.200.0930.02415.18
5.4.190.0980.02415.11
5.4.180.1070.02314.85
5.4.170.0970.02014.98
5.4.160.0950.02314.80
5.4.150.1050.02315.13
5.4.140.1180.02313.53
5.4.130.1050.02413.79
5.4.120.0850.02313.96
5.4.110.1080.02313.68
5.4.100.1010.02513.73
5.4.90.0980.02213.80
5.4.80.1100.02213.72
5.4.70.1080.02113.77
5.4.60.1110.01813.82
5.4.50.1030.02413.56
5.4.40.1080.02113.84
5.4.30.1080.02313.83
5.4.20.1090.01913.84
5.4.10.0910.02313.75
5.4.00.1070.02013.43
5.3.290.1020.02512.63
5.3.280.1120.02312.58
5.3.270.0900.02312.71
5.3.260.1050.02712.65
5.3.250.1020.02112.61
5.3.240.1050.02212.66
5.3.230.1000.02712.58
5.3.220.1060.02812.58
5.3.210.1080.02112.39
5.3.200.1070.01912.55
5.3.190.0050.04012.55
5.3.180.0030.02112.60
5.3.170.0480.03712.68
5.3.160.1020.02012.48
5.3.150.1100.02912.70
5.3.140.0970.02312.60
5.3.130.0980.01812.60
5.3.120.0980.02112.58
5.3.110.1070.02312.73
5.3.100.0200.02012.24
5.3.90.0000.03212.26
5.3.80.0030.02612.25
5.3.70.0650.02512.35
5.3.60.1000.02312.33
5.3.50.0900.02112.19
5.3.40.0020.02512.19
5.3.30.0030.02112.20
5.3.20.0300.04412.18
5.3.10.0970.02112.03
5.3.00.1230.02812.00
5.2.170.1900.03011.15
5.2.160.2000.03311.08
5.2.150.1900.03711.13
5.2.140.1430.03011.08
5.2.130.1730.01711.04
5.2.120.1600.03011.04
5.2.110.1870.03711.05
5.2.100.1830.03311.13
5.2.90.0900.03011.04
5.2.80.0070.06011.15
5.2.70.0030.04711.34
5.2.60.0030.05711.00
5.2.50.0300.03311.12
5.2.40.0000.05710.89
5.2.30.0100.05310.92
5.2.20.0070.03011.03
5.2.10.0000.06010.96
5.2.00.0130.05310.67
5.1.60.0130.0239.93
5.1.50.0170.0339.93
5.1.40.0170.0209.89
5.1.30.0100.02710.28
5.1.20.0130.02710.31
5.1.10.0130.05710.21
5.1.00.0130.03010.00
5.0.50.0070.0478.59
5.0.40.0070.0208.54
5.0.30.0100.0478.24
5.0.20.0070.0238.16
5.0.10.0130.0378.20
5.0.00.0100.0638.43
4.4.90.0070.0177.96
4.4.80.0100.0307.96
4.4.70.0100.0177.96
4.4.60.0070.0337.96
4.4.50.0070.0337.96
4.4.40.0070.0437.96
4.4.30.0100.0377.96
4.4.20.0100.0177.96
4.4.10.0070.0177.96
4.4.00.0030.0337.96
4.3.110.0100.0277.96
4.3.100.0100.0207.96
4.3.90.0100.0137.96
4.3.80.0070.0277.96
4.3.70.0100.0307.96
4.3.60.0100.0177.96
4.3.50.0070.0307.96
4.3.40.0070.0507.96
4.3.30.0000.0407.96
4.3.20.0070.0337.96
4.3.10.0100.0307.96
4.3.00.0070.0237.96

preferences:
47.39 ms | 401 KiB | 5 Q