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(); echo $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.0110.01118.43
8.3.50.0110.00922.05
8.3.40.0120.00919.02
8.3.30.0070.00719.10
8.3.20.0040.00420.25
8.3.10.0050.00321.97
8.3.00.0040.00422.59
8.2.180.0130.00616.75
8.2.170.0090.00622.96
8.2.160.0100.00722.14
8.2.150.0080.00024.18
8.2.140.0070.00724.66
8.2.130.0000.00726.16
8.2.120.0030.00619.45
8.2.110.0130.00922.29
8.2.100.0080.00419.50
8.2.90.0000.00819.17
8.2.80.0050.00318.05
8.2.70.0060.00317.63
8.2.60.0030.00517.93
8.2.50.0050.00318.07
8.2.40.0000.00918.16
8.2.30.0000.00718.15
8.2.20.0030.00517.82
8.2.10.0050.00319.64
8.2.00.0060.00317.77
8.1.280.0110.00725.92
8.1.270.0080.00022.04
8.1.260.0050.00226.35
8.1.250.0040.00428.09
8.1.240.0080.00023.83
8.1.230.0030.00919.15
8.1.220.0040.00417.79
8.1.210.0040.00418.77
8.1.200.0040.00417.36
8.1.190.0080.00017.66
8.1.180.0030.00518.10
8.1.170.0000.00818.64
8.1.160.0000.00722.03
8.1.150.0080.00018.67
8.1.140.0000.00717.52
8.1.130.0040.00417.79
8.1.120.0000.00717.52
8.1.110.0000.00817.48
8.1.100.0000.00717.38
8.1.90.0080.00017.53
8.1.80.0050.00317.51
8.1.70.0000.00717.48
8.1.60.0060.00317.64
8.1.50.0040.00417.54
8.1.40.0030.00617.51
8.1.30.0000.00717.73
8.1.20.0060.00317.64
8.1.10.0040.00417.59
8.1.00.0030.00517.56
8.0.300.0050.00218.77
8.0.290.0000.00817.30
8.0.280.0040.00418.36
8.0.270.0030.00317.30
8.0.260.0070.00016.86
8.0.250.0030.00416.90
8.0.240.0000.00717.00
8.0.230.0000.00717.03
8.0.220.0030.00317.02
8.0.210.0000.00716.97
8.0.200.0030.00316.95
8.0.190.0050.00316.95
8.0.180.0070.00017.09
8.0.170.0040.00416.91
8.0.160.0040.00416.94
8.0.150.0050.00316.94
8.0.140.0040.00416.86
8.0.130.0030.00313.46
8.0.120.0030.00517.07
8.0.110.0030.00517.02
8.0.100.0070.00016.89
8.0.90.0000.00816.86
8.0.80.0060.01017.00
8.0.70.0040.00416.89
8.0.60.0070.00016.83
8.0.50.0080.00017.05
8.0.30.0120.01017.15
8.0.20.0120.01117.40
8.0.10.0020.00516.97
8.0.00.0090.00916.82
7.4.330.0000.00615.00
7.4.320.0040.00416.54
7.4.300.0030.00316.54
7.4.290.0080.00016.56
7.4.280.0030.00316.54
7.4.270.0020.00516.64
7.4.260.0080.00316.54
7.4.250.0040.00416.57
7.4.240.0030.00416.56
7.4.230.0000.00716.55
7.4.220.0100.00716.55
7.4.210.0070.01016.62
7.4.200.0050.00216.71
7.4.190.0030.00316.54
7.4.160.0070.01016.64
7.4.150.0120.01117.40
7.4.140.0070.01317.86
7.4.130.0130.01116.67
7.4.120.0100.00716.57
7.4.110.0100.00716.61
7.4.100.0070.01316.57
7.4.90.0160.00616.42
7.4.80.0060.01219.39
7.4.70.0090.00916.66
7.4.60.0120.00416.52
7.4.50.0050.00016.61
7.4.40.0030.01622.77
7.4.30.0030.01316.41
7.4.00.0060.01115.06
7.3.330.0000.00513.20
7.3.320.0000.00613.43
7.3.310.0040.00416.30
7.3.300.0030.00316.38
7.3.290.0100.00716.40
7.3.280.0090.01016.38
7.3.270.0120.00917.40
7.3.260.0090.01216.32
7.3.250.0140.00716.52
7.3.240.0100.01016.70
7.3.230.0100.00716.50
7.3.210.0060.01216.61
7.3.200.0060.01019.39
7.3.190.0110.01116.30
7.3.180.0130.00316.38
7.3.170.0200.00016.37
7.3.160.0120.00316.46
7.3.120.0090.00715.58
7.3.110.0070.00815.73
7.3.100.0080.00715.62
7.3.90.0090.00415.54
7.3.80.0060.00715.59
7.3.70.0080.00515.60
7.3.60.0090.00615.59
7.3.50.0050.00915.65
7.3.40.0050.00515.57
7.3.30.0030.01015.59
7.3.20.0080.00616.78
7.3.10.0110.00316.71
7.3.00.0070.00616.76
7.2.330.0040.01516.68
7.2.320.0030.02116.84
7.2.310.0070.01016.72
7.2.300.0130.00316.70
7.2.290.0080.00816.83
7.2.250.0060.01115.15
7.2.240.0090.00915.68
7.2.230.0020.01215.84
7.2.220.0020.01015.81
7.2.210.0040.01215.88
7.2.200.0090.00415.75
7.2.190.0050.00915.82
7.2.180.0020.00915.91
7.2.170.0040.00915.66
7.2.160.0040.01215.95
7.2.150.0080.00517.08
7.2.140.0100.00517.05
7.2.130.0040.00916.96
7.2.120.0060.00816.99
7.2.110.0070.00616.95
7.2.100.0070.00616.95
7.2.90.0050.01016.96
7.2.80.0050.00716.99
7.2.70.0050.01217.01
7.2.60.0040.01216.92
7.2.50.0040.01117.00
7.2.40.0070.00717.09
7.2.30.0090.00816.99
7.2.20.0060.00716.90
7.2.10.0060.00917.05
7.2.00.0080.00617.59
7.1.330.0070.01016.30
7.1.320.0050.00716.23
7.1.310.0030.01116.20
7.1.300.0080.00716.36
7.1.290.0090.00516.15
7.1.280.0050.00816.24
7.1.270.0050.00616.18
7.1.260.0030.00916.17
7.1.250.0080.00616.21
7.1.240.0030.00715.48
7.1.230.0110.00315.82
7.1.220.0080.00615.85
7.1.210.0000.00915.97
7.1.200.0060.00615.88
7.1.190.0100.00315.70
7.1.180.0030.00915.76
7.1.170.0070.00715.53
7.1.160.0070.00315.88
7.1.150.0000.01015.71
7.1.140.0070.00715.87
7.1.130.0000.00815.84
7.1.120.0040.01415.76
7.1.110.0030.01315.56
7.1.100.0030.01216.84
7.1.90.0040.00815.61
7.1.80.0070.00715.72
7.1.70.0080.00416.18
7.1.60.0100.01017.84
7.1.50.0050.00716.43
7.1.40.0000.01315.91
7.1.30.0040.00815.75
7.1.20.0070.00715.81
7.1.10.0130.00315.89
7.1.00.0030.04119.21
7.0.330.0030.00715.36
7.0.320.0030.01015.49
7.0.310.0140.00015.59
7.0.300.0030.00615.29
7.0.290.0040.00715.39
7.0.280.0090.00615.58
7.0.270.0030.00615.29
7.0.260.0100.00715.57
7.0.250.0100.00715.21
7.0.240.0130.00315.50
7.0.230.0060.00615.52
7.0.220.0070.00715.29
7.0.210.0060.00315.50
7.0.200.0040.00616.22
7.0.190.0070.00715.20
7.0.180.0120.00315.35
7.0.170.0030.00815.45
7.0.160.0040.00415.31
7.0.150.0000.01215.16
7.0.140.0050.03818.67
7.0.130.0100.00315.54
7.0.120.0000.00815.33
7.0.110.0040.00715.50
7.0.100.0000.00915.14
7.0.90.0090.00315.23
7.0.80.0120.00615.04
7.0.70.0060.00315.27
7.0.60.0000.03317.76
7.0.50.0050.03016.73
7.0.40.0030.04716.82
7.0.30.0130.02016.72
7.0.20.0150.03216.79
7.0.10.0100.02316.63
7.0.00.0060.04616.87
5.6.400.0000.01414.62
5.6.390.0040.00714.11
5.6.380.0060.00614.41
5.6.370.0100.00714.55
5.6.360.0090.00614.11
5.6.350.0030.01414.53
5.6.340.0070.00314.77
5.6.330.0090.00014.69
5.6.320.0100.00614.20
5.6.310.0070.01014.24
5.6.300.0000.00914.23
5.6.290.0120.00014.60
5.6.280.0050.04017.94
5.6.270.0070.00714.62
5.6.260.0040.00814.51
5.6.250.0030.00714.51
5.6.240.0090.00614.47
5.6.230.0030.00614.59
5.6.220.0080.00414.31
5.6.210.0030.03117.58
5.6.200.0080.04216.40
5.6.190.0080.02717.36
5.6.180.0120.02717.44
5.6.170.0140.03417.43
5.6.160.0060.02117.34
5.6.150.0080.02516.27
5.6.140.0120.03016.21
5.6.130.0050.02316.43
5.6.120.0040.02717.77
5.6.110.0160.03817.81
5.6.100.0070.04917.73
5.6.90.0110.04217.84
5.6.80.0050.02717.32
5.6.70.0040.00814.35
5.6.60.0060.00614.63
5.6.50.0060.00614.26
5.6.40.0030.00914.13
5.6.30.0040.00714.28
5.6.20.0060.00314.19
5.6.10.0100.00314.46
5.6.00.0040.01114.33
5.5.380.0000.01514.46
5.5.370.0040.00714.57
5.5.360.0030.01014.54
5.5.350.0170.04217.46
5.5.340.0080.02216.22
5.5.330.0120.02817.50
5.5.320.0170.03217.37
5.5.310.0100.03017.35
5.5.300.0170.03116.34
5.5.290.0080.03616.21
5.5.280.0090.02817.65
5.5.270.0120.03317.47
5.5.260.0110.02417.61
5.5.250.0050.04217.54
5.5.240.0080.04017.44
5.5.230.0130.00014.50
5.5.220.0060.00614.29
5.5.210.0030.01214.13
5.5.200.0060.00614.24
5.5.190.0000.01214.15
5.5.180.0000.01014.34
5.5.170.0100.00314.04
5.5.160.0130.00314.16
5.5.150.0030.01414.26
5.5.140.0120.00014.46
5.5.130.0060.01113.87
5.5.120.0000.01014.37
5.5.110.0040.00814.52
5.5.100.0170.00014.36
5.5.90.0000.01414.14
5.5.80.0140.00014.44
5.5.70.0100.00714.46
5.5.60.0040.00714.56
5.5.50.0000.01314.13
5.5.40.0060.00614.42
5.5.30.0070.00414.35
5.5.20.0030.01014.27
5.5.10.0090.00614.23
5.5.00.0040.01114.07
5.4.450.0400.02515.24
5.4.440.0230.02315.29
5.4.430.0500.01815.33
5.4.420.0490.02215.38
5.4.410.0180.02315.38
5.4.400.0330.02215.13
5.4.390.0300.02015.07
5.4.380.0200.03714.91
5.4.370.0210.03314.85
5.4.360.0100.03614.84
5.4.350.0210.03014.86
5.4.340.0170.03214.68
5.4.330.0030.00311.15
5.4.320.0050.02311.76
5.4.310.0090.02411.83
5.4.300.0060.02411.84
5.4.290.0040.02611.70
5.4.280.0060.02711.76
5.4.270.0070.03014.97
5.4.260.0080.03815.10
5.4.250.0110.03015.09
5.4.240.0080.02914.83
5.4.230.0110.03115.04
5.4.220.0080.04115.12
5.4.210.0030.03215.05
5.4.200.0100.03715.12
5.4.190.0080.03714.99
5.4.180.0070.03015.03
5.4.170.0070.03014.96
5.4.160.0070.03515.03
5.4.150.0080.03514.91
5.4.140.0110.03413.75
5.4.130.0100.03213.95
5.4.120.0090.02613.65
5.4.110.0030.03013.90
5.4.100.0050.03013.70
5.4.90.0020.03313.80
5.4.80.0060.03313.79
5.4.70.0090.03913.84
5.4.60.0020.03013.87
5.4.50.0140.02913.72
5.4.40.0070.02613.78
5.4.30.0060.03113.68
5.4.20.0100.03113.86
5.4.10.0100.03813.85
5.4.00.0080.02913.57
5.3.290.0050.02111.77
5.3.280.0080.03412.64
5.3.270.0080.04012.60
5.3.260.0130.03312.60
5.3.250.0010.03512.73
5.3.240.0080.02612.69
5.3.230.0070.02712.72
5.3.220.0020.03912.47
5.3.210.0050.03212.53
5.3.200.0070.03812.54
5.3.190.0070.02712.72
5.3.180.0070.02812.58
5.3.170.0060.03312.54
5.3.160.0080.03512.71
5.3.150.0120.02712.58
5.3.140.0110.02512.63
5.3.130.0030.03212.58
5.3.120.0030.03812.65
5.3.110.0070.02812.65
5.3.100.0060.02612.24
5.3.90.0110.03112.44
5.3.80.0100.02512.27
5.3.70.0050.03312.35
5.3.60.0070.03812.25
5.3.50.0100.02212.33
5.3.40.0100.02212.25
5.3.30.0030.03512.30
5.3.20.0080.02812.13
5.3.10.0070.03712.10
5.3.00.0080.03312.06
5.2.170.0030.04311.25
5.2.160.0030.05011.07
5.2.150.0070.04711.07
5.2.140.0070.04311.16
5.2.130.0000.05711.20
5.2.120.0000.04311.20
5.2.110.0100.04311.20
5.2.100.0070.04011.34
5.2.90.0130.03311.20
5.2.80.0100.05011.33
5.2.70.0100.04011.29
5.2.60.0000.04311.07
5.2.50.0070.04311.27
5.2.40.0030.04011.18
5.2.30.0030.04011.08
5.2.20.0030.04710.95
5.2.10.0170.03010.88
5.2.00.0000.05310.81
5.1.60.0030.03310.18
5.1.50.0070.03710.12
5.1.40.0000.03710.16
5.1.30.0030.04710.35
5.1.20.0030.05310.55
5.1.10.0070.03310.18
5.1.00.0100.03310.06
5.0.50.0070.0238.67
5.0.40.0070.0278.36
5.0.30.0030.0438.21
5.0.20.0070.0278.29
5.0.10.0100.0338.17
5.0.00.0000.0538.29
4.4.90.0000.0335.84
4.4.80.0030.0305.85
4.4.70.0000.0275.85
4.4.60.0000.0235.84
4.4.50.0000.0235.86
4.4.40.0030.0335.86
4.4.30.0100.0235.82
4.4.20.0030.0235.92
4.4.10.0070.0275.89
4.4.00.0030.0335.85
4.3.110.0070.0175.79
4.3.100.0000.0235.77
4.3.90.0000.0275.82
4.3.80.0000.0335.77
4.3.70.0030.0305.77
4.3.60.0030.0205.77
4.3.50.0000.0235.77
4.3.40.0100.0275.78
4.3.30.0070.0235.77
4.3.20.0000.0235.77
4.3.10.0000.0275.77
4.3.00.0000.02015.57

preferences:
45.6 ms | 401 KiB | 5 Q