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 $store; 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()) { echo $items . '!'; $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 />"; 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.0120.00617.13
8.3.50.0100.01122.00
8.3.40.0070.00718.79
8.3.30.0030.01019.17
8.3.20.0040.00420.21
8.3.10.0080.00023.56
8.3.00.0040.00420.95
8.2.180.0120.00316.63
8.2.170.0040.01122.96
8.2.160.0100.00320.38
8.2.150.0030.00524.18
8.2.140.0070.00024.66
8.2.130.0130.00726.16
8.2.120.0030.00522.29
8.2.110.0090.00022.06
8.2.100.0120.00317.78
8.2.90.0000.00819.17
8.2.80.0030.00717.97
8.2.70.0080.00017.63
8.2.60.0100.00017.78
8.2.50.0040.00418.07
8.2.40.0040.00418.34
8.2.30.0000.00718.15
8.2.20.0000.00817.76
8.2.10.0050.00317.88
8.2.00.0060.00317.85
8.1.280.0160.00325.92
8.1.270.0040.00423.72
8.1.260.0000.00826.35
8.1.250.0040.00428.09
8.1.240.0100.00023.77
8.1.230.0060.00619.16
8.1.220.0000.00817.78
8.1.210.0030.00518.77
8.1.200.0060.00317.23
8.1.190.0050.00317.66
8.1.180.0040.00418.10
8.1.170.0080.00018.50
8.1.160.0050.00222.06
8.1.150.0040.00418.69
8.1.140.0060.00317.56
8.1.130.0030.00317.79
8.1.120.0040.00417.55
8.1.110.0000.00717.38
8.1.100.0080.00017.41
8.1.90.0000.00817.43
8.1.80.0000.00717.50
8.1.70.0040.00417.36
8.1.60.0000.00917.51
8.1.50.0000.00817.59
8.1.40.0040.00417.58
8.1.30.0040.00417.63
8.1.20.0030.00517.74
8.1.10.0080.00017.63
8.1.00.0040.00417.47
8.0.300.0000.00718.77
8.0.290.0050.00317.30
8.0.280.0070.00018.56
8.0.270.0050.00317.31
8.0.260.0000.00716.82
8.0.250.0030.00317.06
8.0.240.0040.00416.96
8.0.230.0030.00317.08
8.0.220.0000.00716.98
8.0.210.0030.00317.02
8.0.200.0030.00317.04
8.0.190.0050.00317.03
8.0.180.0000.00816.93
8.0.170.0030.00616.92
8.0.160.0080.00016.95
8.0.150.0000.00716.92
8.0.140.0050.00316.95
8.0.130.0050.00013.39
8.0.120.0080.00016.88
8.0.110.0000.00816.96
8.0.100.0080.00017.12
8.0.90.0050.00216.88
8.0.80.0090.00616.96
8.0.70.0040.00417.02
8.0.60.0040.00416.90
8.0.50.0040.00417.05
8.0.30.0080.01117.10
8.0.20.0130.00817.40
8.0.10.0070.00017.19
8.0.00.0080.01016.71
7.4.330.0050.00015.12
7.4.320.0000.00616.56
7.4.300.0000.00616.55
7.4.290.0050.00216.63
7.4.280.0030.00316.58
7.4.270.0040.00416.64
7.4.260.0030.00316.54
7.4.250.0050.00216.61
7.4.240.0040.00316.59
7.4.230.0000.00716.60
7.4.220.0120.00616.57
7.4.210.0070.00916.57
7.4.200.0000.00716.54
7.4.190.0000.00716.77
7.4.160.0030.01316.57
7.4.150.0090.00817.40
7.4.140.0130.00617.86
7.4.130.0070.01016.49
7.4.120.0100.00916.54
7.4.110.0070.01016.62
7.4.100.0130.00616.70
7.4.90.0100.00716.71
7.4.80.0040.01416.70
7.4.70.0100.00716.58
7.4.60.0090.00916.54
7.4.50.0000.00516.68
7.4.40.0070.00722.77
7.4.30.0030.01416.61
7.4.10.0130.00715.05
7.4.00.0060.01215.24
7.3.330.0060.00013.39
7.3.320.0080.00013.41
7.3.310.0040.00416.45
7.3.300.0030.00316.52
7.3.290.0030.01216.46
7.3.280.0090.00816.49
7.3.270.0080.00817.40
7.3.260.0130.00616.65
7.3.250.0150.00416.59
7.3.240.0120.00916.43
7.3.230.0120.00416.47
7.3.210.0090.00916.45
7.3.200.0080.00819.39
7.3.190.0160.00016.67
7.3.180.0100.01016.44
7.3.170.0100.00616.51
7.3.160.0050.01116.47
7.3.130.0100.01014.80
7.3.120.0100.00714.90
7.3.110.0120.00514.89
7.3.100.0050.00914.88
7.3.90.0020.01514.91
7.3.80.0000.01315.01
7.3.70.0070.00314.86
7.3.60.0070.00714.95
7.3.50.0080.00514.80
7.3.40.0060.00814.70
7.3.30.0080.00714.98
7.3.20.0090.00716.75
7.3.10.0050.00816.73
7.3.00.0020.00916.82
7.2.330.0030.01516.85
7.2.320.0090.00916.75
7.2.310.0100.00716.74
7.2.300.0130.00916.50
7.2.290.0100.00616.69
7.2.260.0030.01614.96
7.2.250.0080.00915.19
7.2.240.0090.00715.01
7.2.230.0070.01015.09
7.2.220.0050.00515.16
7.2.210.0040.01415.10
7.2.200.0030.00715.29
7.2.190.0080.00915.07
7.2.180.0040.01015.10
7.2.170.0050.00514.97
7.2.160.0070.00915.16
7.2.150.0030.01216.95
7.2.140.0090.00316.95
7.2.130.0020.01316.94
7.2.120.0080.00817.00
7.2.110.0080.00816.95
7.2.100.0070.01016.85
7.2.90.0080.00816.91
7.2.80.0040.00816.69
7.2.70.0080.00817.02
7.2.60.0020.01217.04
7.2.50.0090.00516.84
7.2.40.0050.01017.06
7.2.30.0100.00616.92
7.2.20.0090.00816.81
7.2.10.0080.00417.02
7.2.00.0090.00617.82
7.1.330.0060.01115.88
7.1.320.0020.01315.86
7.1.310.0020.00915.93
7.1.300.0100.00515.65
7.1.290.0050.00815.75
7.1.280.0050.00615.70
7.1.270.0050.01215.76
7.1.260.0060.00815.74
7.1.250.0080.00515.85
7.1.240.0000.01315.65
7.1.230.0040.01115.71
7.1.220.0030.00615.87
7.1.210.0100.00315.69
7.1.200.0080.00615.91
7.1.190.0070.00715.91
7.1.180.0060.00615.67
7.1.170.0120.00315.95
7.1.160.0030.01015.63
7.1.150.0060.00915.71
7.1.140.0000.01015.82
7.1.130.0030.01015.91
7.1.120.0060.00615.80
7.1.110.0080.00015.91
7.1.100.0050.01016.94
7.1.90.0070.00715.61
7.1.80.0150.00015.77
7.1.70.0060.00716.56
7.1.60.0090.00717.47
7.1.50.0040.01116.23
7.1.40.0110.00415.84
7.1.30.0030.00615.83
7.1.20.0030.00615.82
7.1.10.0090.00415.78
7.1.00.0030.04319.04
7.0.330.0040.00415.23
7.0.320.0100.00315.42
7.0.310.0030.01015.54
7.0.300.0070.00715.32
7.0.290.0070.00315.37
7.0.280.0030.01115.36
7.0.270.0070.00715.44
7.0.260.0040.00715.39
7.0.250.0030.00615.51
7.0.240.0040.00815.55
7.0.230.0030.00615.19
7.0.220.0090.00615.23
7.0.210.0150.00015.29
7.0.200.0090.00516.06
7.0.190.0000.00915.32
7.0.180.0080.00415.49
7.0.170.0040.00815.39
7.0.160.0000.01315.18
7.0.150.0030.00615.54
7.0.140.0070.03818.81
7.0.130.0100.00315.65
7.0.120.0080.00015.35
7.0.110.0040.01115.20
7.0.100.0030.00815.29
7.0.90.0120.00315.54
7.0.80.0060.00315.42
7.0.70.0060.00915.22
7.0.60.0090.04017.82
7.0.50.0080.03016.73
7.0.40.0050.02816.94
7.0.30.0200.02616.71
7.0.20.0220.03116.80
7.0.10.0150.03816.94
7.0.00.0080.04716.84
5.6.400.0040.00714.68
5.6.390.0030.00614.77
5.6.380.0030.01314.58
5.6.370.0090.00614.62
5.6.360.0040.00414.68
5.6.350.0090.00614.72
5.6.340.0120.00014.48
5.6.330.0000.01214.64
5.6.320.0070.01014.42
5.6.310.0000.01614.53
5.6.300.0040.00814.56
5.6.290.0000.01214.39
5.6.280.0050.03917.85
5.6.270.0000.01014.51
5.6.260.0060.00314.43
5.6.250.0040.00814.39
5.6.240.0090.00314.36
5.6.230.0000.01114.62
5.6.220.0040.00814.73
5.6.210.0090.04217.61
5.6.200.0070.02216.19
5.6.190.0080.04517.46
5.6.180.0080.03517.43
5.6.170.0200.03017.51
5.6.160.0070.04717.41
5.6.150.0050.02316.29
5.6.140.0050.04716.32
5.6.130.0110.04516.18
5.6.120.0050.02617.69
5.6.110.0070.04217.72
5.6.100.0100.04017.79
5.6.90.0060.02817.73
5.6.80.0020.03517.44
5.6.70.0130.02017.34
5.6.60.0030.00614.50
5.6.50.0090.00914.52
5.6.40.0060.01014.47
5.6.30.0060.00614.20
5.6.20.0060.00614.41
5.6.10.0100.00314.22
5.6.00.0030.01214.68
5.5.380.0030.00714.51
5.5.370.0030.01014.45
5.5.360.0070.00714.80
5.5.350.0040.04517.48
5.5.340.0050.02516.20
5.5.330.0090.02217.28
5.5.320.0090.04017.22
5.5.310.0130.02817.43
5.5.300.0040.04716.07
5.5.290.0050.03916.09
5.5.280.0080.02117.74
5.5.270.0030.02717.59
5.5.260.0030.04817.71
5.5.250.0050.04217.50
5.5.240.0000.03517.29
5.5.230.0130.00014.42
5.5.220.0030.01014.15
5.5.210.0070.01014.41
5.5.200.0090.00614.61
5.5.190.0000.01014.61
5.5.180.0060.00914.57
5.5.170.0030.00914.59
5.5.160.0060.00914.04
5.5.150.0060.00614.03
5.5.140.0070.00714.33
5.5.130.0030.01014.57
5.5.120.0030.01114.43
5.5.110.0030.00914.00
5.5.100.0070.00714.20
5.5.90.0060.00914.36
5.5.80.0070.00714.49
5.5.70.0030.00914.61
5.5.60.0040.01114.26
5.5.50.0000.00814.50
5.5.40.0030.00914.42
5.5.30.0030.01314.33
5.5.20.0070.00714.61
5.5.10.0120.00614.33
5.5.00.0060.00614.48
5.4.450.0500.03115.68
5.4.440.0580.04115.55
5.4.430.0520.04615.63
5.4.420.0830.03515.49
5.4.410.0430.03515.62
5.4.400.0470.04215.33
5.4.390.0100.03315.33
5.4.380.0120.03215.30
5.4.370.0090.03115.20
5.4.360.0180.02315.14
5.4.350.0130.02815.17
5.4.340.0170.02315.29
5.4.330.0070.00311.79
5.4.320.0030.02512.16
5.4.310.0060.01912.15
5.4.300.0060.02112.16
5.4.290.0080.02012.15
5.4.280.0020.02712.10
5.4.270.0050.02412.09
5.4.260.0080.02512.09
5.4.250.0040.02512.09
5.4.240.0040.02412.09
5.4.230.0020.02412.08
5.4.220.0040.02112.08
5.4.210.0050.02112.09
5.4.200.0120.03012.08
5.4.190.0080.02812.08
5.4.180.0050.02612.08
5.4.170.0090.01912.09
5.4.160.0050.02012.08
5.4.150.0050.01912.08
5.4.140.0020.02811.92
5.4.130.0070.02511.92
5.4.120.0080.02111.89
5.4.110.0060.02511.89
5.4.100.0010.02811.89
5.4.90.0070.01911.89
5.4.80.0050.02011.89
5.4.70.0020.02411.89
5.4.60.0030.02311.89
5.4.50.0080.01911.89
5.4.40.0050.02511.89
5.4.30.0040.03911.89
5.4.20.0070.03311.89
5.4.10.0040.02511.89
5.4.00.0080.02211.63
5.3.290.0040.02312.30
5.3.280.0050.02612.25
5.3.270.0040.03212.26
5.3.260.0070.03612.26
5.3.250.0040.03512.26
5.3.240.0060.02212.25
5.3.230.0080.02312.25
5.3.220.0070.03212.24
5.3.210.0130.04712.24
5.3.200.0070.03012.24
5.3.190.0060.02712.23
5.3.180.0060.02112.23
5.3.170.0060.02112.23
5.3.160.0050.02212.23
5.3.150.0040.02412.23
5.3.140.0040.02212.23
5.3.130.0060.02912.22
5.3.120.0090.02912.22
5.3.110.0070.02812.23
5.3.100.0080.02211.96
5.3.90.0050.02311.94
5.3.80.0040.02311.94
5.3.70.0070.02011.93
5.3.60.0070.02511.93
5.3.50.0040.03011.90
5.3.40.0080.02511.90
5.3.30.0060.02211.88
5.3.20.0040.02311.77
5.3.10.0020.02311.75
5.3.00.0050.02111.74
5.2.170.0050.0469.20
5.2.160.0080.0389.20
5.2.150.0050.0359.20
5.2.140.0090.0389.20
5.2.130.0060.0359.16
5.2.120.0080.0439.16
5.2.110.0040.0439.16
5.2.100.0100.0389.16
5.2.90.0020.0339.16
5.2.80.0040.0429.17
5.2.70.0060.0409.16
5.2.60.0070.0309.11
5.2.50.0060.0319.08
5.2.40.0040.0299.06
5.2.30.0050.0339.04
5.2.20.0060.0319.02
5.2.10.0060.0308.93
5.2.00.0040.0338.79
5.1.60.0080.0418.08
5.1.50.0160.0468.08
5.1.40.0030.0358.06
5.1.30.0070.0318.41
5.1.20.0080.0318.44
5.1.10.0070.0338.16
5.1.00.0060.0358.16
5.0.50.0040.0296.64
5.0.40.0060.0266.50
5.0.30.0070.0396.32
5.0.20.0100.0406.29
5.0.10.0110.0246.26
5.0.00.0070.0416.26
4.4.90.0060.0244.78
4.4.80.0010.0264.75
4.4.70.0060.0164.75
4.4.60.0030.0204.76
4.4.50.0040.0144.77
4.4.40.0050.0354.71
4.4.30.0030.0224.76
4.4.20.0070.0194.84
4.4.10.0030.0164.85
4.4.00.0050.0234.76
4.3.110.0030.0204.67
4.3.100.0040.0194.66
4.3.90.0050.0134.64
4.3.80.0050.0224.59
4.3.70.0010.0164.63
4.3.60.0090.0094.62
4.3.50.0030.0164.63
4.3.40.0020.0264.53
4.3.30.0010.0173.29
4.3.20.0010.0183.26
4.3.10.0020.0163.23
4.3.00.0000.01713.14

preferences:
47.11 ms | 401 KiB | 5 Q