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(); 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.40.0140.00418.76
8.3.30.0110.00319.22
8.3.20.0080.00020.39
8.3.10.0040.00421.98
8.3.00.0040.00422.34
8.2.170.0080.00822.96
8.2.160.0070.00722.25
8.2.150.0040.00424.18
8.2.140.0060.00924.66
8.2.130.0070.00026.16
8.2.120.0030.00619.18
8.2.110.0060.00319.32
8.2.100.0060.00618.22
8.2.90.0040.00419.08
8.2.80.0040.00417.97
8.2.70.0090.00017.63
8.2.60.0060.00317.91
8.2.50.0030.00618.10
8.2.40.0000.00720.55
8.2.30.0030.00619.15
8.2.20.0040.00417.57
8.2.10.0040.00419.46
8.2.00.0040.00417.77
8.1.270.0000.00722.20
8.1.260.0000.00726.35
8.1.250.0080.00028.09
8.1.240.0100.00022.62
8.1.230.0120.00020.44
8.1.220.0030.00617.74
8.1.210.0060.00318.77
8.1.200.0000.00917.35
8.1.190.0000.00817.25
8.1.180.0080.00018.10
8.1.170.0080.00018.54
8.1.160.0040.00418.86
8.1.150.0000.00720.01
8.1.140.0040.00417.47
8.1.130.0030.00517.86
8.1.120.0070.00017.45
8.1.110.0000.00717.45
8.1.100.0040.00417.37
8.1.90.0050.00217.32
8.1.80.0000.00817.48
8.1.70.0030.00317.32
8.1.60.0030.00617.52
8.1.50.0030.00517.62
8.1.40.0040.00417.54
8.1.30.0000.00817.56
8.1.20.0000.00817.57
8.1.10.0000.00817.64
8.1.00.0000.00917.61
8.0.300.0020.00519.21
8.0.290.0000.00716.63
8.0.280.0000.00818.41
8.0.270.0040.00417.28
8.0.260.0070.00016.84
8.0.250.0040.00416.96
8.0.240.0000.00716.98
8.0.230.0030.00316.96
8.0.220.0030.00416.80
8.0.210.0000.00716.91
8.0.200.0030.00316.86
8.0.190.0050.00216.91
8.0.180.0050.00316.93
8.0.170.0080.00016.93
8.0.160.0020.00516.98
8.0.150.0040.00416.91
8.0.140.0040.00416.79
8.0.130.0030.00313.38
8.0.120.0000.00816.90
8.0.110.0040.00416.89
8.0.100.0030.00516.74
8.0.90.0000.00816.86
8.0.80.0170.00316.88
8.0.70.0000.00816.89
8.0.60.0000.00716.84
8.0.50.0000.00716.78
8.0.30.0100.00917.01
8.0.20.0100.00917.40
8.0.10.0030.00517.07
8.0.00.0140.00916.73
7.4.330.0000.00715.00
7.4.320.0000.00616.59
7.4.300.0030.00316.54
7.4.290.0030.01016.52
7.4.280.0000.00716.51
7.4.270.0030.00316.67
7.4.260.0060.00316.61
7.4.250.0040.00416.57
7.4.240.0060.00116.55
7.4.230.0030.00316.41
7.4.220.0130.00316.72
7.4.210.0100.00516.59
7.4.200.0040.00416.39
7.4.190.0030.00316.43
7.4.160.0130.00316.52
7.4.150.0150.00317.40
7.4.140.0100.01117.86
7.4.130.0060.01316.48
7.4.120.0090.00816.49
7.4.110.0130.00316.61
7.4.100.0150.00316.70
7.4.90.0120.00616.56
7.4.80.0090.00919.39
7.4.70.0090.00916.55
7.4.60.0070.01016.55
7.4.50.0000.00916.60
7.4.40.0120.00622.77
7.4.30.0130.00316.66
7.4.00.0090.00714.96
7.3.330.0000.00513.29
7.3.320.0030.00313.31
7.3.310.0050.00516.38
7.3.300.0000.00716.18
7.3.290.0120.00316.32
7.3.280.0070.00916.30
7.3.270.0090.00917.40
7.3.260.0030.01416.34
7.3.250.0120.00916.37
7.3.240.0100.01016.62
7.3.230.0000.01716.64
7.3.210.0080.00916.37
7.3.200.0080.00919.39
7.3.190.0100.01316.54
7.3.180.0090.00616.43
7.3.170.0140.00316.59
7.3.160.0120.00316.45
7.3.120.0090.00714.91
7.3.110.0090.00315.06
7.3.100.0040.01114.95
7.3.90.0070.00314.82
7.3.80.0070.00714.75
7.3.70.0070.01014.69
7.3.60.0030.01014.97
7.3.50.0040.01214.77
7.3.40.0100.00714.87
7.3.30.0030.01014.50
7.3.20.0060.00316.41
7.3.10.0050.00816.49
7.3.00.0050.00816.46
7.2.330.0080.01216.35
7.2.320.0090.00916.32
7.2.310.0060.01116.60
7.2.300.0080.00816.61
7.2.290.0100.00616.37
7.2.250.0030.01414.90
7.2.240.0060.01314.88
7.2.230.0030.01014.82
7.2.220.0080.00814.99
7.2.210.0000.01515.12
7.2.200.0090.00914.91
7.2.190.0090.00614.90
7.2.180.0060.00615.11
7.2.170.0110.00714.99
7.2.130.0080.00716.68
7.2.120.0070.00816.86
7.2.110.0060.00616.92
7.2.100.0090.00816.81
7.2.90.0070.01016.72
7.2.80.0080.00416.84
7.2.70.0050.00916.71
7.2.60.0070.00616.84
7.2.50.0070.00816.91
7.2.40.0080.00916.95
7.2.30.0060.00616.64
7.2.20.0010.00816.69
7.2.10.0110.00816.67
7.2.00.0040.00817.58
7.1.330.0070.00715.64
7.1.320.0130.00315.58
7.1.310.0000.01415.56
7.1.300.0100.00015.29
7.1.290.0030.01015.70
7.1.280.0000.01215.41
7.1.270.0030.00615.46
7.1.260.0100.00315.73
7.1.250.0050.00715.45
7.1.200.0000.00815.77
7.1.100.0060.00617.82
7.1.70.0030.00617.10
7.1.60.0110.01419.82
7.1.50.0100.01016.83
7.1.00.0100.09022.31
7.0.200.0000.00716.72
7.0.140.0000.07321.95
7.0.60.0070.05319.95
7.0.50.0130.08017.98
7.0.40.0000.04720.05
7.0.30.0370.06320.18
7.0.20.0230.05320.12
7.0.10.0070.04020.24
7.0.00.0130.08320.05
5.6.280.0030.07320.87
5.6.210.0170.07320.65
5.6.200.0030.04318.16
5.6.190.0070.09020.64
5.6.180.0530.06720.63
5.6.170.0230.08320.50
5.6.160.0100.04720.46
5.6.150.0100.08018.19
5.6.140.0000.04718.21
5.6.130.0100.07318.14
5.6.120.0100.07320.74
5.6.110.0030.09020.95
5.6.100.0170.07321.03
5.6.90.0130.08721.01
5.6.80.0100.06020.54
5.5.350.0300.04020.42
5.5.340.0000.04318.04
5.5.330.0130.08320.42
5.5.320.0400.05320.32
5.5.310.0330.07020.24
5.5.300.0130.07717.97
5.5.290.0130.03717.93
5.5.280.0030.05720.78
5.5.270.0070.08320.64
5.5.260.0070.08320.91
5.5.250.0170.06320.79
5.5.240.0200.07020.17
5.4.450.0330.04319.28
5.4.440.0600.05019.64
5.4.430.0530.04719.54
5.4.420.0800.03719.47
5.4.410.0700.04019.36
5.4.400.0770.03019.18
5.4.390.0830.04019.17
5.4.380.0830.06718.57
5.4.370.1170.05018.63
5.4.360.0970.06318.76
5.4.350.1030.07718.61
5.4.340.0930.05318.71
5.4.320.0050.04312.52
5.4.310.0060.04112.51
5.4.300.0080.03812.51
5.4.290.0050.04312.51
5.4.280.0060.04012.41
5.4.270.0100.07318.98
5.4.260.0000.05719.05
5.4.250.0130.07018.76
5.4.240.0200.06718.95
5.4.230.0100.07318.96
5.4.220.0070.05318.75
5.4.210.0270.05718.73
5.4.200.0270.06318.89
5.4.190.0130.05318.89
5.4.180.0070.05319.02
5.4.170.0030.08319.09
5.4.160.0230.06018.99
5.4.150.0170.07318.98
5.4.140.0100.05316.45
5.4.130.0100.06316.47
5.4.120.0200.04016.64
5.4.110.0070.05316.47
5.4.100.0070.04716.44
5.4.90.0070.05316.54
5.4.80.0130.04016.50
5.4.70.0100.05316.69
5.4.60.0070.05016.38
5.4.50.0100.05316.43
5.4.40.0200.05316.52
5.4.30.0070.05316.34
5.4.20.0130.06016.61
5.4.10.0100.07016.48
5.4.00.0070.05015.94
5.3.290.0070.04012.80
5.3.280.0030.06014.69
5.3.270.0130.06714.76
5.3.260.0070.05314.71
5.3.250.0100.05014.71
5.3.240.0130.06714.45
5.3.230.0100.06014.75
5.3.220.0070.05314.49
5.3.210.0130.05014.64
5.3.200.0130.04314.75
5.3.190.0170.04714.76
5.3.180.0170.06714.64
5.3.170.0070.05714.41
5.3.160.0100.05714.72
5.3.150.0170.05014.57
5.3.140.0200.06714.79
5.3.130.0070.08014.65
5.3.120.0170.04314.59
5.3.110.0130.04714.55
5.3.100.0170.05313.95
5.3.90.0130.05014.21
5.3.80.0130.05314.00
5.3.70.0030.06014.22
5.3.60.0100.05014.12
5.3.50.0130.06313.98
5.3.40.0130.06313.95
5.3.30.0070.05313.92
5.3.20.0130.04313.80
5.3.10.0100.04313.56
5.3.00.0070.05313.73
5.2.170.0070.04311.15
5.2.160.0070.05711.09
5.2.150.0070.06011.24
5.2.140.0070.06311.11
5.2.130.0030.05711.09
5.2.120.0070.04011.02
5.2.110.0030.05311.02
5.2.100.0000.04711.12
5.2.90.0000.05011.19
5.2.80.0070.05711.33
5.2.70.0100.04711.28
5.2.60.0100.04011.07
5.2.50.0100.05711.13
5.2.40.0070.04310.97
5.2.30.0030.04310.81
5.2.20.0100.05011.05
5.2.10.0170.03011.03
5.2.00.0070.04010.74
5.1.60.0030.05310.02
5.1.50.0030.04010.12
5.1.40.0170.03710.06
5.1.30.0030.05710.41
5.1.20.0030.04710.44
5.1.10.0170.03010.18
5.1.00.0230.0279.95
5.0.50.0070.0308.66
5.0.40.0100.0238.54
5.0.30.0070.0408.31
5.0.20.0070.0278.27
5.0.10.0030.0308.26
5.0.00.0030.0608.43
4.4.90.0070.0275.88
4.4.80.0000.0235.91
4.4.70.0030.0275.83
4.4.60.0000.0275.82
4.4.50.0000.0335.89
4.4.40.0070.0335.89
4.4.30.0070.0205.89
4.4.20.0070.0175.86
4.4.10.0070.0205.92
4.4.00.0070.0305.88
4.3.110.0000.0235.78
4.3.100.0030.0275.78
4.3.90.0000.0235.82
4.3.80.0030.0435.71
4.3.70.0070.0205.82
4.3.60.0000.0275.77
4.3.50.0030.0305.73
4.3.40.0000.0475.71
4.3.30.0070.0205.38
4.3.20.0000.0235.38
4.3.10.0030.0275.38
4.3.00.0030.02015.57

preferences:
46.8 ms | 400 KiB | 5 Q