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 static $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.0150.00618.68
8.3.50.0130.01121.99
8.3.40.0150.00018.96
8.3.30.0070.00719.09
8.3.20.0030.00620.21
8.3.10.0050.00322.13
8.3.00.0090.00022.39
8.2.180.0040.01516.63
8.2.170.0150.00622.96
8.2.160.0070.01022.21
8.2.150.0040.00424.18
8.2.140.0070.00724.66
8.2.130.0040.00426.16
8.2.120.0080.00019.61
8.2.110.0070.00422.21
8.2.100.0080.00419.76
8.2.90.0000.00819.04
8.2.80.0050.00317.97
8.2.70.0060.00317.63
8.2.60.0000.00818.05
8.2.50.0040.00418.07
8.2.40.0040.00418.19
8.2.30.0030.00518.22
8.2.20.0030.00617.81
8.2.10.0050.00319.53
8.2.00.0000.00717.64
8.1.280.0120.00325.92
8.1.270.0040.00422.02
8.1.260.0000.00826.35
8.1.250.0040.00428.09
8.1.240.0090.00023.80
8.1.230.0080.00319.00
8.1.220.0030.00517.74
8.1.210.0040.00418.77
8.1.200.0060.00617.35
8.1.190.0040.00417.52
8.1.180.0050.00318.10
8.1.170.0000.00918.64
8.1.160.0070.00021.99
8.1.150.0000.00818.68
8.1.140.0040.00417.49
8.1.130.0030.00317.90
8.1.120.0050.00317.39
8.1.110.0050.00217.45
8.1.100.0000.00717.40
8.1.90.0040.00417.34
8.1.80.0040.00417.57
8.1.70.0030.00317.53
8.1.60.0000.00817.64
8.1.50.0030.00517.61
8.1.40.0080.00017.44
8.1.30.0030.00617.64
8.1.20.0040.00417.66
8.1.10.0000.00817.61
8.1.00.0030.00517.40
8.0.300.0070.00018.77
8.0.290.0050.00217.16
8.0.280.0030.00518.36
8.0.270.0030.00317.36
8.0.260.0000.00616.83
8.0.250.0000.00716.98
8.0.240.0000.00816.99
8.0.230.0000.00717.10
8.0.220.0000.00717.00
8.0.210.0030.00316.97
8.0.200.0030.00317.07
8.0.190.0000.00717.07
8.0.180.0040.00416.89
8.0.170.0060.00316.98
8.0.160.0000.00817.01
8.0.150.0040.00416.95
8.0.140.0040.00416.94
8.0.130.0000.00513.49
8.0.120.0040.00416.92
8.0.110.0040.00416.92
8.0.100.0040.00416.84
8.0.90.0030.00516.86
8.0.80.0100.00716.96
8.0.70.0000.00717.06
8.0.60.0000.00716.78
8.0.50.0040.00417.05
8.0.30.0120.00917.03
8.0.20.0070.01217.40
8.0.10.0000.00817.16
8.0.00.0100.01416.88
7.4.330.0000.00615.00
7.4.320.0030.00316.62
7.4.300.0030.00316.57
7.4.290.0070.00416.54
7.4.280.0000.00716.43
7.4.270.0040.00416.45
7.4.260.0060.00516.49
7.4.250.0040.00416.52
7.4.240.0050.00316.67
7.4.230.0030.00316.54
7.4.220.0100.00716.63
7.4.210.0090.00716.55
7.4.200.0040.00416.66
7.4.190.0040.00416.59
7.4.160.0080.00816.66
7.4.150.0130.00617.40
7.4.140.0100.00717.86
7.4.130.0110.00816.66
7.4.120.0110.00716.60
7.4.110.0120.00316.68
7.4.100.0110.00716.35
7.4.90.0110.00716.59
7.4.80.0100.01319.39
7.4.70.0080.00916.59
7.4.60.0030.01316.59
7.4.50.0030.00516.44
7.4.40.0040.01422.77
7.4.30.0050.01116.52
7.4.00.0060.00315.16
7.3.330.0000.00613.30
7.3.320.0000.00513.46
7.3.310.0060.00316.43
7.3.300.0000.00716.44
7.3.290.0110.00316.38
7.3.280.0080.00916.44
7.3.270.0090.00917.40
7.3.260.0130.01016.51
7.3.250.0110.00816.53
7.3.240.0090.00816.37
7.3.230.0140.00416.65
7.3.210.0000.01616.42
7.3.200.0060.01019.39
7.3.190.0070.01116.55
7.3.180.0110.00416.37
7.3.170.0100.00716.55
7.3.160.0160.00016.68
7.3.120.0120.00314.73
7.2.330.0080.00816.83
7.2.320.0140.01016.82
7.2.310.0080.00816.52
7.2.300.0090.00916.71
7.2.290.0120.00416.83
7.2.60.0030.01116.90
7.2.00.0040.00719.27
7.1.200.0030.00715.68
7.1.100.0000.01118.43
7.1.70.0050.00217.18
7.1.60.0100.01319.82
7.1.50.0040.02117.03
7.1.00.0070.09022.30
7.0.200.0000.00816.50
7.0.140.0000.07722.19
7.0.60.0000.04319.94
7.0.50.0100.06717.75
7.0.40.0000.04720.21
7.0.30.0300.07020.09
7.0.20.0270.05720.12
7.0.10.0300.07720.25
7.0.00.0070.06720.06
5.6.280.0030.07321.06
5.6.210.0100.07020.68
5.6.200.0030.06718.18
5.6.190.0070.09020.48
5.6.180.4070.04320.55
5.6.170.0200.04020.39
5.6.160.0100.04020.39
5.6.150.0170.07318.19
5.6.140.0170.07018.18
5.6.130.0100.07318.26
5.6.120.0100.07721.21
5.6.110.0100.05321.15
5.6.100.0200.06720.96
5.6.90.0070.08021.11
5.6.80.0030.05320.39
5.6.70.0270.06020.38
5.5.350.0070.08020.42
5.5.340.0130.04717.94
5.5.330.0070.04020.27
5.5.320.0330.05720.28
5.5.310.0270.05020.26
5.5.300.0000.06718.05
5.5.290.0070.06717.94
5.5.280.0030.08720.75
5.5.270.0030.05720.98
5.5.260.0170.05720.69
5.5.250.0100.06720.70
5.5.240.0000.05320.20
5.4.450.0070.05019.20
5.4.440.0270.03719.16
5.4.430.2330.04719.41
5.4.420.2500.03719.51
5.4.410.2200.03319.26
5.4.400.2400.03719.09
5.4.390.2400.03719.24
5.4.380.2400.04018.87
5.4.370.2400.03019.31
5.4.360.2170.03719.22
5.4.350.2130.04019.11
5.4.340.2400.04719.20
5.4.320.2330.03719.16
5.4.310.2030.04019.31
5.4.300.2100.03319.31
5.4.290.2130.04319.19
5.4.280.2400.04719.16
5.4.270.2200.03719.08
5.4.260.2400.03719.09
5.4.250.2370.03719.13
5.4.240.2430.04319.18
5.4.230.2370.04019.24
5.4.220.2400.03319.16
5.4.210.2100.04019.24
5.4.200.1870.02718.94
5.4.190.2230.04719.18
5.4.180.2100.03718.99
5.4.170.2100.03719.05
5.4.160.2100.03719.14
5.4.150.1930.03718.97
5.4.140.1930.03316.43
5.4.130.2070.04316.54
5.4.120.2070.03316.42
5.4.110.1930.04016.30
5.4.100.2230.03016.63
5.4.90.2370.03716.45
5.4.80.2230.03316.57
5.4.70.2200.03016.44
5.4.60.2000.03316.34
5.4.50.2200.03016.44
5.4.40.1970.03316.34
5.4.30.2170.03316.25
5.4.20.2070.03316.52
5.4.10.2230.03316.38
5.4.00.2200.03015.89
5.3.290.2170.03714.91
5.3.280.2170.03314.70
5.3.270.2100.03714.62
5.3.260.2130.03714.78
5.3.250.2230.03314.62
5.3.240.2300.03314.62
5.3.230.2500.05014.63
5.3.220.2070.04014.56
5.3.210.2130.03714.82
5.3.200.2170.03714.56
5.3.190.2270.04014.60
5.3.180.2370.03314.57
5.3.170.2370.03714.81
5.3.160.2130.03314.48
5.3.150.2100.03314.66
5.3.140.2330.04014.66
5.3.130.2200.04014.57
5.3.120.2330.04314.69
5.3.110.2330.04014.69
5.3.100.2330.04313.96
5.3.90.2330.03014.05
5.3.80.2030.04014.02
5.3.70.2300.03313.95
5.3.60.2170.03313.96
5.3.50.2500.03713.90
5.3.40.2330.03713.88
5.3.30.2930.03013.95
5.3.20.2270.04713.64
5.3.10.2370.04013.61
5.3.00.2170.03013.88
5.2.170.2070.03011.18
5.2.160.1700.03311.11
5.2.150.1800.02711.11
5.2.140.2000.02711.10
5.2.130.1970.03011.14
5.2.120.1900.03011.21
5.2.110.2070.02311.15
5.2.100.1770.02711.05
5.2.90.1730.02711.36
5.2.80.2400.02011.05
5.2.70.1630.03011.21
5.2.60.1900.03011.30
5.2.50.2100.03010.97
5.2.40.1470.03011.08
5.2.30.0070.05710.92
5.2.20.0030.03711.07
5.2.10.0030.03310.80
5.2.00.1230.03010.66
5.1.60.1370.03010.25
5.1.50.1400.0309.96
5.1.40.1470.0239.91
5.1.30.1530.03010.33
5.1.20.1400.03010.29
5.1.10.1370.02710.33
5.1.00.1330.02710.23
5.0.50.0700.0209.49
5.0.40.0830.0309.49
5.0.30.0900.0439.49
5.0.20.0670.0239.49
5.0.10.0900.0309.49
5.0.00.0800.0539.49
4.4.90.0730.0179.49
4.4.80.0700.0139.49
4.4.70.0870.0139.49
4.4.60.0900.0209.49
4.4.50.0770.0239.49
4.4.40.0800.0409.49
4.4.30.0700.0139.49
4.4.20.0670.0179.49
4.4.10.0770.0179.49
4.4.00.0600.0279.49
4.3.110.0800.0179.49
4.3.100.0770.0279.49
4.3.90.0770.0179.49
4.3.80.0770.0279.49
4.3.70.0770.0209.49
4.3.60.0670.0139.49
4.3.50.0670.0139.49
4.3.40.0770.0309.49
4.3.30.0500.0239.49
4.3.20.0330.0209.49
4.3.10.0300.0179.49
4.3.00.0300.0179.49

preferences:
46.78 ms | 401 KiB | 5 Q