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; } } $test = new testCase(); //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"); array_merge(range(0,25), range('a','z')); /* 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.0080.01118.31
8.3.50.0100.01022.05
8.3.40.0060.01218.84
8.3.30.0070.00719.09
8.3.20.0040.00420.34
8.3.10.0080.00022.27
8.3.00.0050.00222.64
8.2.180.0120.00616.88
8.2.170.0170.00322.96
8.2.160.0030.01321.78
8.2.150.0030.00624.18
8.2.140.0080.00024.66
8.2.130.0040.01126.16
8.2.120.0060.00319.48
8.2.110.0060.00322.20
8.2.100.0080.00317.97
8.2.90.0040.00419.24
8.2.80.0060.00317.97
8.2.70.0040.00417.50
8.2.60.0030.00617.93
8.2.50.0000.00818.07
8.2.40.0000.00818.09
8.2.30.0020.00518.06
8.2.20.0080.00017.67
8.2.10.0040.00419.48
8.2.00.0050.00517.68
8.1.280.0070.00725.92
8.1.270.0040.00422.19
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0060.00323.84
8.1.230.0110.00019.15
8.1.220.0040.00417.74
8.1.210.0080.00018.77
8.1.200.0110.00017.22
8.1.190.0040.00417.30
8.1.180.0110.00018.10
8.1.170.0060.00318.64
8.1.160.0000.00721.95
8.1.150.0020.00518.65
8.1.140.0020.00517.52
8.1.130.0000.00817.78
8.1.120.0070.00017.40
8.1.110.0070.00017.39
8.1.100.0040.00417.50
8.1.90.0040.00417.32
8.1.80.0000.00717.47
8.1.70.0000.00717.43
8.1.60.0060.00617.57
8.1.50.0070.00017.53
8.1.40.0040.00417.54
8.1.30.0040.00417.56
8.1.20.0050.00317.68
8.1.10.0000.00817.64
8.1.00.0070.00017.53
8.0.300.0000.00918.77
8.0.290.0080.00017.04
8.0.280.0030.00318.45
8.0.270.0050.00217.27
8.0.260.0060.00016.88
8.0.250.0040.00417.05
8.0.240.0040.00517.05
8.0.230.0030.00316.95
8.0.220.0070.00016.99
8.0.210.0040.00416.84
8.0.200.0040.00417.05
8.0.190.0040.00416.98
8.0.180.0000.00716.99
8.0.170.0050.00217.08
8.0.160.0040.00417.04
8.0.150.0000.00716.91
8.0.140.0070.00016.81
8.0.130.0060.00013.46
8.0.120.0030.00616.96
8.0.110.0000.00716.99
8.0.100.0040.00417.03
8.0.90.0080.00017.01
8.0.80.0100.00716.98
8.0.70.0030.00516.87
8.0.60.0050.00216.88
8.0.50.0020.00517.00
8.0.30.0140.00617.09
8.0.20.0080.01117.40
8.0.10.0030.00317.21
8.0.00.0150.00516.75
7.4.330.0030.00315.00
7.4.320.0000.00716.51
7.4.300.0030.00316.60
7.4.290.0000.01016.63
7.4.280.0000.00716.46
7.4.270.0000.00716.47
7.4.260.0040.00416.61
7.4.250.0000.00716.58
7.4.240.0060.00216.53
7.4.230.0070.00016.55
7.4.220.0060.01316.49
7.4.210.0040.01116.55
7.4.200.0020.00516.59
7.4.190.0030.00316.55
7.4.160.0030.01216.58
7.4.150.0120.01217.40
7.4.140.0090.01017.86
7.4.130.0080.01116.57
7.4.120.0120.00516.68
7.4.110.0110.00516.43
7.4.100.0060.01116.48
7.4.90.0100.01016.70
7.4.80.0120.00919.39
7.4.70.0040.01316.38
7.4.60.0030.01416.49
7.4.50.0000.00916.62
7.4.40.0050.00522.77
7.4.30.0060.01016.59
7.4.00.0080.01014.99
7.3.330.0000.00513.24
7.3.320.0000.00613.38
7.3.310.0050.00316.25
7.3.300.0040.00416.36
7.3.290.0110.00816.38
7.3.280.0110.00516.41
7.3.270.0090.00917.40
7.3.260.0070.01116.71
7.3.250.0110.00916.57
7.3.240.0100.01016.48
7.3.230.0060.01016.57
7.3.210.0090.00916.29
7.3.200.0070.01319.39
7.3.190.0070.01716.26
7.3.180.0030.01316.68
7.3.170.0120.00616.54
7.3.160.0150.00016.68
7.3.120.0070.01014.88
7.3.110.0100.01014.98
7.3.100.0030.01215.04
7.3.90.0030.00614.65
7.3.80.0070.00314.88
7.3.70.0030.01014.87
7.3.60.0060.00314.79
7.3.50.0040.00814.71
7.3.40.0030.00914.70
7.3.30.0070.01014.79
7.3.20.0030.01316.61
7.3.10.0050.00816.75
7.3.00.0060.00816.81
7.2.330.0000.01716.77
7.2.320.0100.00716.52
7.2.310.0060.01016.67
7.2.300.0110.00716.81
7.2.290.0060.01116.77
7.2.250.0100.00715.36
7.2.240.0060.01215.27
7.2.230.0030.01215.04
7.2.220.0070.00315.13
7.2.210.0060.00315.32
7.2.200.0000.00915.20
7.2.190.0030.00814.89
7.2.180.0060.00914.99
7.2.170.0070.00715.16
7.2.130.0070.00716.90
7.2.120.0000.01617.09
7.2.110.0070.00716.80
7.2.100.0100.00717.00
7.2.90.0030.01017.01
7.2.80.0030.01016.98
7.2.70.0060.01516.96
7.2.60.0060.00716.75
7.2.50.0060.00916.97
7.2.40.0060.00617.01
7.2.30.0050.00517.09
7.2.20.0000.01017.09
7.2.10.0040.00816.97
7.2.00.0070.00716.96
7.1.330.0130.00315.99
7.1.320.0040.01115.70
7.1.310.0030.00715.48
7.1.300.0030.00915.49
7.1.290.0070.00715.73
7.1.280.0070.01015.82
7.1.270.0090.00915.57
7.1.260.0030.00715.79
7.1.250.0000.01615.64
7.1.240.0090.00315.88
7.1.230.0070.00715.57
7.1.220.0040.00815.75
7.1.210.0030.00915.90
7.1.200.0100.00515.80
7.1.190.0050.00315.64
7.1.180.0070.00715.71
7.1.170.0070.00715.80
7.1.160.0070.00815.93
7.1.150.0060.00615.71
7.1.140.0080.00615.61
7.1.130.0000.01315.80
7.1.120.0120.00315.77
7.1.110.0100.00715.91
7.1.100.0080.00815.85
7.1.90.0100.00315.45
7.1.80.0160.00015.89
7.1.70.0030.00716.26
7.1.60.0100.00917.71
7.1.50.0110.00716.30
7.1.40.0070.00715.76
7.1.30.0060.00315.71
7.1.20.0060.00915.48
7.1.10.0140.00015.84
7.1.00.0070.04019.03
7.0.330.0040.01115.35
7.0.320.0060.01214.97
7.0.310.0040.00715.46
7.0.300.0090.00615.41
7.0.290.0000.00915.37
7.0.280.0040.01115.31
7.0.270.0030.01015.33
7.0.260.0060.00615.35
7.0.250.0070.00715.36
7.0.240.0080.00815.34
7.0.230.0000.01015.10
7.0.220.0040.00815.41
7.0.210.0070.00715.42
7.0.200.0070.00416.08
7.0.190.0050.00515.56
7.0.180.0090.00615.26
7.0.170.0070.00715.44
7.0.160.0060.00315.44
7.0.150.0030.01015.32
7.0.140.0030.04018.69
7.0.130.0000.01215.43
7.0.120.0070.01015.20
7.0.110.0040.01115.17
7.0.100.0030.00715.41
7.0.90.0100.00315.16
7.0.80.0080.00415.38
7.0.70.0070.01015.18
7.0.60.0170.04017.58
7.0.50.0090.04216.74
7.0.40.0050.04316.83
7.0.30.0190.02716.65
7.0.20.0190.02716.62
7.0.10.0030.02716.74
7.0.00.0080.04016.77
5.6.380.0090.00014.41
5.6.370.0070.00713.98
5.6.360.0070.00314.17
5.6.350.0070.00714.26
5.6.340.0070.00714.66
5.6.330.0070.00314.39
5.6.320.0100.00314.33
5.6.310.0040.00714.45
5.6.300.0030.01314.23
5.6.290.0060.00914.68
5.6.280.0060.03717.84
5.6.270.0030.00614.34
5.6.260.0040.01114.24
5.6.250.0120.00614.45
5.6.240.0060.00614.11
5.6.230.0030.01014.16
5.6.220.0140.00014.40
5.6.210.0080.04217.48
5.6.200.0060.02516.28
5.6.190.0050.02917.42
5.6.180.0200.03017.42
5.6.170.0170.03817.43
5.6.160.0070.02517.45
5.6.150.0070.03916.23
5.6.140.0140.03516.21
5.6.130.0080.02216.36
5.6.120.0070.04517.73
5.6.110.0070.04717.69
5.6.100.0070.04417.74
5.6.90.0050.04517.61
5.6.80.0050.03217.27
5.6.70.0150.00414.33
5.6.60.0070.00714.27
5.6.50.0170.00314.46
5.6.40.0060.00314.39
5.6.30.0090.00914.00
5.6.20.0060.00914.29
5.6.10.0180.00714.35
5.6.00.0090.00914.45
5.5.380.0060.00611.05
5.5.370.0060.00611.05
5.5.360.0040.00711.36
5.5.350.0220.03415.84
5.5.340.0120.02514.71
5.5.330.0130.02115.94
5.5.320.0050.02215.89
5.5.310.0150.03315.88
5.5.300.0060.04514.57
5.5.290.0080.02214.73
5.5.280.0020.02616.04
5.5.270.0150.03816.01
5.5.260.0080.03816.17
5.5.250.0070.03215.87
5.5.240.0150.04015.81
5.5.230.0030.00310.90
5.5.220.0000.00611.29
5.5.210.0030.00311.18
5.5.200.0040.00411.28
5.5.190.0090.00011.27
5.5.180.0040.00811.29
5.5.170.0060.00911.01
5.5.160.0040.00411.37
5.5.150.0060.00311.26
5.5.140.0070.00711.15
5.5.130.0060.00611.30
5.5.120.0030.01111.18
5.5.110.0090.00910.93
5.5.100.0130.00311.17
5.5.90.0040.00411.23
5.5.80.0040.00411.00
5.5.70.0050.01011.05
5.5.60.0120.00411.19
5.5.50.0030.00311.11
5.5.40.0040.00411.29
5.5.30.0000.00811.04
5.5.20.0080.00811.20
5.5.10.0030.00611.02
5.5.00.0080.00011.03
5.4.450.0230.04215.39
5.4.440.0270.02815.24
5.4.430.0350.02815.36
5.4.420.0380.02015.01
5.4.410.0450.02015.00
5.4.400.0330.02615.26
5.4.390.0360.02115.07
5.4.380.0120.02814.96
5.4.370.0130.02815.04
5.4.360.0100.02814.80
5.4.350.0120.03014.84
5.4.340.0100.03314.71
5.4.330.0140.00010.91
5.4.320.0080.01911.86
5.4.310.0100.02111.73
5.4.300.0040.02111.73
5.4.290.0050.02311.93
5.4.280.0040.02111.75
5.4.270.0120.03014.94
5.4.260.0090.03514.91
5.4.250.0080.03414.94
5.4.240.0100.02514.96
5.4.230.0030.03114.96
5.4.220.0110.03315.00
5.4.210.0110.02514.98
5.4.200.0090.02714.96
5.4.190.0080.03415.08
5.4.180.0060.03914.90
5.4.170.0080.04314.86
5.4.160.0110.03715.09
5.4.150.0080.03815.04
5.4.140.0040.03013.73
5.4.130.0070.03613.65
5.4.120.0080.02813.77
5.4.110.0120.03113.72
5.4.100.0050.03113.79
5.4.90.0100.02813.73
5.4.80.0070.02813.80
5.4.70.0070.03813.86
5.4.60.0150.02013.68
5.4.50.0050.02813.79
5.4.40.0050.03013.73
5.4.30.0070.03413.66
5.4.20.0100.02513.78
5.4.10.0060.03513.73
5.4.00.0070.03513.54
5.3.290.0070.02411.77
5.3.280.0110.03312.56
5.3.270.0080.03612.52
5.3.260.0040.03012.45
5.3.250.0030.04012.61
5.3.240.0070.04012.65
5.3.230.0060.04012.64
5.3.220.0100.02812.46
5.3.210.0100.03812.52
5.3.200.0070.03912.49
5.3.190.0070.02812.47
5.3.180.0030.04412.62
5.3.170.0080.02512.56
5.3.160.0080.03312.45
5.3.150.0090.03712.57
5.3.140.0080.02712.53
5.3.130.0110.03512.61
5.3.120.0050.03012.57
5.3.110.0080.03612.56
5.3.100.0020.02912.37
5.3.90.0080.02812.37
5.3.80.0040.03712.21
5.3.70.0030.03112.07
5.3.60.0070.03512.26
5.3.50.0020.03212.32
5.3.40.0110.02412.22
5.3.30.0100.03312.31
5.3.20.0070.03112.27
5.3.10.0090.03112.03
5.3.00.0110.02212.03
5.2.170.0000.03510.57
5.2.160.0030.02410.61
5.2.150.0070.02810.52
5.2.140.0100.03010.50
5.2.130.0030.02710.54
5.2.120.0030.03510.49
5.2.110.0040.03010.50
5.2.100.0050.03110.55
5.2.90.0050.02510.46
5.2.80.0070.02410.48
5.2.70.0020.02610.50
5.2.60.0100.02210.48
5.2.50.0010.02610.45
5.2.40.0080.02610.41
5.2.30.0050.02710.52
5.2.20.0070.02010.48
5.2.10.0060.02310.36
5.2.00.0080.02210.35
5.1.60.0070.0249.98
5.1.50.0030.0269.95
5.1.40.0030.0219.91
5.1.30.0020.02910.21
5.1.20.0050.02010.14
5.1.10.0040.0209.97
5.1.00.0060.0239.99
5.0.50.0050.0199.31
5.0.40.0060.0189.16
5.0.30.0070.0259.06
5.0.20.0070.0129.05
5.0.10.0070.0159.12
5.0.00.0020.0279.03
4.4.90.0010.0157.87
4.4.80.0070.0087.85
4.4.70.0020.0187.87
4.4.60.0020.0187.87
4.4.50.0040.0137.90
4.4.40.0030.0297.83
4.4.30.0020.0157.85
4.4.20.0030.0177.89
4.4.10.0020.0137.90
4.4.00.0000.0257.88
4.3.110.0030.0157.84
4.3.100.0060.0137.83
4.3.90.0000.0147.81
4.3.80.0020.0207.78
4.3.70.0030.0107.80
4.3.60.0040.0137.82
4.3.50.0040.0167.82
4.3.40.0060.0187.81
4.3.30.0040.0177.68
4.3.20.0030.0137.68
4.3.10.0050.0157.68
4.3.00.0030.00612.73

preferences:
42.65 ms | 401 KiB | 5 Q