3v4l.org

run code in 300+ PHP versions simultaneously
<?php class testCase { private $stores; public function doFunction($items = array(), $out ) { foreach($items as $num => $val) { 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? */ //$out = "<br />"; } return $this->store = $out; } /* PRIVATE, SO NOT ACCESSIBLE! FIX: make public */ 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 { private $stores; public function doFunction($items = array(), $out = "") { foreach($items as $num => $val) { if($num % 2 == 0) { $out += (string) $val; } else { $out += strtoupper($val); } $out += "<br />"; } return $this->store = $out; } 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; } } $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.0170.00318.43
8.3.50.0120.00922.05
8.3.40.0150.00418.93
8.3.30.0070.00719.22
8.3.20.0040.00420.32
8.3.10.0080.00021.92
8.3.00.0070.00022.40
8.2.180.0150.00018.16
8.2.170.0110.00322.96
8.2.160.0080.00822.13
8.2.150.0000.00824.18
8.2.140.0040.01524.66
8.2.130.0060.00326.16
8.2.120.0050.00517.71
8.2.110.0040.00420.35
8.2.100.0080.00417.84
8.2.90.0000.00719.21
8.2.80.0040.00418.05
8.2.70.0050.00317.75
8.2.60.0000.00818.05
8.2.50.0000.00818.07
8.2.40.0030.00618.28
8.2.30.0070.00018.15
8.2.20.0040.00417.68
8.2.10.0030.00519.47
8.2.00.0030.00517.70
8.1.280.0090.01225.92
8.1.270.0050.00222.18
8.1.260.0000.00826.35
8.1.250.0030.00528.09
8.1.240.0100.00323.86
8.1.230.0070.00420.93
8.1.220.0050.00317.78
8.1.210.0040.00418.77
8.1.200.0060.00317.35
8.1.190.0040.00417.18
8.1.180.0080.00018.10
8.1.170.0000.00918.65
8.1.160.0000.00822.07
8.1.150.0040.00418.67
8.1.140.0040.00417.43
8.1.130.0000.00717.73
8.1.120.0000.00717.49
8.1.110.0060.00317.41
8.1.100.0000.00817.40
8.1.90.0000.00717.48
8.1.80.0030.00517.53
8.1.70.0030.00317.42
8.1.60.0000.00917.59
8.1.50.0000.00717.47
8.1.40.0050.00217.55
8.1.30.0040.00417.61
8.1.20.0040.00417.67
8.1.10.0040.00417.56
8.1.00.0030.00517.50
8.0.300.0040.00418.77
8.0.290.0070.00017.13
8.0.280.0000.00718.52
8.0.270.0000.00817.35
8.0.260.0030.00316.78
8.0.250.0030.00317.01
8.0.240.0040.00416.93
8.0.230.0030.00317.04
8.0.220.0070.00017.04
8.0.210.0040.00416.93
8.0.200.0000.00716.97
8.0.190.0080.00017.06
8.0.180.0070.00016.90
8.0.170.0060.00316.96
8.0.160.0080.00016.97
8.0.150.0000.00716.93
8.0.140.0080.00016.87
8.0.130.0030.00513.44
8.0.120.0040.00416.83
8.0.110.0070.00016.96
8.0.100.0000.00816.88
8.0.90.0040.00416.93
8.0.80.0090.00616.93
8.0.70.0000.00817.10
8.0.60.0000.00717.03
8.0.50.0000.00716.97
8.0.30.0110.00917.07
8.0.20.0080.01217.40
8.0.10.0000.00717.12
8.0.00.0100.00916.81
7.4.330.0030.00315.00
7.4.320.0030.00316.53
7.4.300.0030.00316.62
7.4.290.0090.00016.54
7.4.280.0040.00416.52
7.4.270.0050.00316.54
7.4.260.0040.00416.56
7.4.250.0060.00316.59
7.4.240.0010.00616.49
7.4.230.0040.00416.60
7.4.220.0070.01016.51
7.4.210.0090.00616.63
7.4.200.0030.00316.36
7.4.190.0040.00316.75
7.4.160.0130.00316.46
7.4.150.0130.00617.40
7.4.140.0110.00817.86
7.4.130.0080.01116.54
7.4.120.0120.00816.64
7.4.110.0130.00316.55
7.4.100.0110.00716.54
7.4.90.0060.01216.61
7.4.80.0150.00419.39
7.4.70.0140.00916.34
7.4.60.0150.00616.36
7.4.50.0000.00416.61
7.4.40.0090.00922.77
7.4.30.0140.00616.60
7.4.00.0060.01114.97
7.3.330.0030.00313.40
7.3.320.0000.00513.38
7.3.310.0000.00716.29
7.3.300.0030.00316.33
7.3.290.0090.00616.43
7.3.280.0100.01016.40
7.3.270.0120.00717.40
7.3.260.0070.01116.40
7.3.250.0130.00616.45
7.3.240.0090.00916.55
7.3.230.0190.00016.60
7.3.210.0150.00716.62
7.3.200.0090.00919.39
7.3.190.0140.00716.58
7.3.180.0080.00816.61
7.3.170.0130.00316.34
7.3.160.0100.00716.33
7.3.120.0090.01014.81
7.3.110.0090.00814.69
7.3.100.0030.01214.80
7.3.90.0030.01314.72
7.3.80.0080.00514.91
7.3.70.0050.00714.73
7.3.60.0060.00614.83
7.3.50.0050.01014.84
7.3.40.0060.00914.68
7.3.30.0050.01014.71
7.3.20.0070.01116.59
7.3.10.0050.00716.57
7.3.00.0050.00716.65
7.2.330.0070.01316.71
7.2.320.0090.01616.39
7.2.310.0070.01116.48
7.2.300.0030.01316.79
7.2.290.0100.00716.75
7.2.250.0080.01015.03
7.2.240.0090.01115.30
7.2.230.0020.01515.13
7.2.220.0080.00715.20
7.2.210.0050.01115.04
7.2.200.0000.01415.05
7.2.190.0030.01015.17
7.2.180.0080.00515.07
7.2.170.0080.00715.16
7.2.130.0090.00617.02
7.2.120.0040.00816.98
7.2.110.0070.00716.73
7.2.100.0080.00416.94
7.2.90.0000.01516.80
7.2.80.0090.00316.66
7.2.70.0040.00716.86
7.2.60.0070.00816.87
7.2.50.0060.00616.78
7.2.40.0110.00016.94
7.2.30.0060.00316.73
7.2.20.0100.00016.96
7.2.10.0040.01116.50
7.2.00.0020.01118.08
7.1.330.0100.00515.87
7.1.320.0050.00815.87
7.1.310.0070.01015.66
7.1.300.0060.00615.59
7.1.290.0040.00915.86
7.1.280.0030.01015.87
7.1.270.0110.00215.83
7.1.260.0040.00915.85
7.1.250.0040.00815.84
7.1.200.0090.00615.96
7.1.100.0000.01318.34
7.1.70.0060.00317.19
7.1.60.0090.01519.82
7.1.50.0180.00616.97
7.1.00.0130.06722.31
7.0.200.0060.00616.72
7.0.140.0000.07721.97
7.0.60.0130.06020.07
7.0.50.0070.03717.89
7.0.40.0070.05020.23
7.0.30.0230.03720.06
7.0.20.0230.08720.12
7.0.10.0200.04720.20
7.0.00.0170.07720.23
5.6.280.0030.07321.11
5.6.210.0170.06720.49
5.6.200.0100.05018.28
5.6.190.0030.04720.50
5.6.180.0370.04320.46
5.6.170.0300.08720.44
5.6.160.0130.07720.44
5.6.150.0070.05018.16
5.6.140.0130.07718.25
5.6.130.0070.03718.14
5.6.120.0070.04020.82
5.6.110.0030.09320.99
5.6.100.0130.08321.01
5.6.90.0100.04720.99
5.6.80.0100.04720.54
5.5.350.0130.08320.45
5.5.340.0030.05018.08
5.5.330.0100.03720.57
5.5.320.0400.07320.28
5.5.310.0300.04720.37
5.5.300.0100.05317.93
5.5.290.0070.06018.04
5.5.280.0130.08020.78
5.5.270.0100.08020.77
5.5.260.0070.08320.78
5.5.250.0070.04020.81
5.5.240.0170.05720.17
5.4.450.0300.04319.53
5.4.440.0370.03719.45
5.4.430.0630.04719.56
5.4.420.0470.06019.54
5.4.410.0970.04019.44
5.4.400.0800.04319.09
5.4.390.0430.06319.22
5.4.380.0170.05318.48
5.4.370.0130.05718.71
5.4.360.0200.07718.64
5.4.350.0270.05318.74
5.4.340.0130.06018.47
5.4.320.0070.03812.52
5.4.310.0040.04112.52
5.4.300.0080.04312.52
5.4.290.0070.04312.52
5.4.280.0050.04312.41
5.4.270.0070.05718.90
5.4.260.0230.04719.09
5.4.250.0000.06318.79
5.4.240.0100.06018.91
5.4.230.0170.06718.65
5.4.220.0030.06018.65
5.4.210.0130.05018.74
5.4.200.0100.07718.96
5.4.190.0130.07318.79
5.4.180.0270.05718.93
5.4.170.0070.07718.74
5.4.160.0130.07318.99
5.4.150.0170.05319.08
5.4.140.0100.06316.48
5.4.130.0170.06016.48
5.4.120.0170.06716.59
5.4.110.0030.06016.54
5.4.100.0100.05316.43
5.4.90.0170.04316.67
5.4.80.0270.05016.66
5.4.70.0130.05316.38
5.4.60.0070.07316.49
5.4.50.0100.05316.44
5.4.40.0100.05316.43
5.4.30.0130.06316.38
5.4.20.0170.04716.48
5.4.10.0100.07716.48
5.4.00.0130.05715.93
5.3.290.0060.04512.80
5.3.280.0100.07014.70
5.3.270.0070.06314.85
5.3.260.0170.06314.81
5.3.250.0030.05714.71
5.3.240.0000.06714.71
5.3.230.0130.07314.71
5.3.220.0200.06014.66
5.3.210.0070.07714.68
5.3.200.0230.05014.42
5.3.190.0200.06014.77
5.3.180.0170.05714.75
5.3.170.0100.06714.57
5.3.160.0100.05014.57
5.3.150.0230.05314.65
5.3.140.0000.07314.69
5.3.130.0200.06314.40
5.3.120.0030.06314.59
5.3.110.0030.06714.80
5.3.100.0130.07014.13
5.3.90.0130.05314.13
5.3.80.0170.06013.95
5.3.70.0030.06014.04
5.3.60.0100.06014.10
5.3.50.0100.05714.04
5.3.40.0200.06014.04
5.3.30.0100.05313.95
5.3.20.0130.06013.72
5.3.10.0100.06713.50
5.3.00.0100.06713.66
5.2.170.0070.06011.15
5.2.160.0030.04311.13
5.2.150.0100.04311.23
5.2.140.0000.05011.15
5.2.130.0100.05011.13
5.2.120.0170.04311.20
5.2.110.0130.03711.10
5.2.100.0100.04311.18
5.2.90.0130.03711.19
5.2.80.0100.04711.20
5.2.70.0030.04711.20
5.2.60.0070.04011.03
5.2.50.0030.05710.89
5.2.40.0000.05310.92
5.2.30.0130.05011.07
5.2.20.0100.04710.97
5.2.10.0030.04310.97
5.2.00.0100.05710.84
5.1.60.0100.0439.99
5.1.50.0030.04710.12
5.1.40.0070.0509.93
5.1.30.0030.05310.54
5.1.20.0030.04310.54
5.1.10.0100.0439.93
5.1.00.0030.04710.05
5.0.50.0030.0308.67
5.0.40.0000.0338.59
5.0.30.0030.0478.22
5.0.20.0030.0308.30
5.0.10.0130.0308.13
5.0.00.0030.0408.28
4.4.90.0070.0206.02
4.4.80.0030.0236.02
4.4.70.0070.0276.02
4.4.60.0000.0276.02
4.4.50.0000.0306.02
4.4.40.0070.0436.02
4.4.30.0000.0306.02
4.4.20.0030.0206.02
4.4.10.0070.0206.02
4.4.00.0100.0376.02
4.3.110.0070.0206.02
4.3.100.0000.0336.02
4.3.90.0070.0176.02
4.3.80.0000.0376.02
4.3.70.0000.0276.02
4.3.60.0030.0276.02
4.3.50.0100.0236.02
4.3.40.0000.0376.02
4.3.30.0030.0306.02
4.3.20.0030.0236.02
4.3.10.0130.0206.02
4.3.00.0000.02015.57

preferences:
49.58 ms | 401 KiB | 5 Q