3v4l.org

run code in 300+ PHP versions simultaneously
<?php $custom_fields = [ 'foo' => '17', 'bar' => '17', ]; $time_intervals = ['day', 'month', 'year', 'hour', 'minute', 'period']; $data = [ 'fooday' => '17', 'foomonth' => 'March', 'name' => 'Chris' ]; function array_string_multiply() { $arrays = func_get_args(); $keys = array_fill(0, array_sum(array_map('count', $arrays)), null); var_dump($keys); // foreach ($keys as $key) { // $sums[$key] = array_reduce($arrays, function ($sum, $arr) use ($key) { return $sum . @$arr[$key]; }); //} // return $sums; } foreach (array_string_multiply(array_keys($custom_fields), $time_intervals) as $key) { var_dump($key); } foreach (array_keys($custom_fields) as $name) { foreach ($time_intervals as $interval_name) { // ; } } var_dump($data); // Result should be array that only contains $data['name'] = 'Chris'

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.0070.00718.68
8.3.50.0090.00722.85
8.3.40.0060.00918.53
8.3.30.0100.00319.11
8.3.20.0040.00420.29
8.3.10.0080.00023.65
8.3.00.0030.00619.13
8.2.180.0110.00416.38
8.2.170.0100.00722.96
8.2.160.0070.00720.30
8.2.150.0040.00424.18
8.2.140.0050.00324.66
8.2.130.0160.00326.16
8.2.120.0040.00420.95
8.2.110.0110.00020.57
8.2.100.0110.00017.84
8.2.90.0040.00419.08
8.2.80.0080.00017.97
8.2.70.0060.00317.63
8.2.60.0060.00317.80
8.2.50.0000.00818.07
8.2.40.0050.00517.98
8.2.30.0060.00318.07
8.2.20.0040.00417.70
8.2.10.0030.00618.00
8.2.00.0040.00417.82
8.1.280.0100.01025.92
8.1.270.0000.00923.97
8.1.260.0030.00626.35
8.1.250.0080.00028.09
8.1.240.0040.00722.46
8.1.230.0040.00720.97
8.1.220.0000.00818.77
8.1.210.0060.00319.04
8.1.200.0030.00617.48
8.1.190.0040.00417.36
8.1.180.0030.00518.10
8.1.170.0000.00818.56
8.1.160.0000.00722.00
8.1.150.0070.00018.89
8.1.140.0040.00417.45
8.1.130.0030.00317.79
8.1.120.0000.00717.48
8.1.110.0000.00817.48
8.1.100.0030.00317.39
8.1.90.0060.00317.43
8.1.80.0000.00717.39
8.1.70.0050.00217.48
8.1.60.0000.00817.53
8.1.50.0050.00317.59
8.1.40.0040.00417.52
8.1.30.0050.00317.57
8.1.20.0030.00617.65
8.1.10.0040.00417.44
8.1.00.0000.00917.40
8.0.300.0030.00619.88
8.0.290.0040.00416.75
8.0.280.0030.00318.39
8.0.270.0050.00317.35
8.0.260.0030.00318.32
8.0.250.0030.00316.92
8.0.240.0040.00417.01
8.0.230.0030.00316.89
8.0.220.0030.00316.95
8.0.210.0000.00716.97
8.0.200.0000.00617.00
8.0.190.0070.00017.09
8.0.180.0020.00516.92
8.0.170.0030.00517.00
8.0.160.0000.00716.84
8.0.150.0000.00716.93
8.0.140.0000.00816.92
8.0.130.0050.00013.38
8.0.120.0040.00416.95
8.0.110.0020.00516.82
8.0.100.0040.00416.86
8.0.90.0000.00816.98
8.0.80.0030.01216.91
8.0.70.0040.00416.85
8.0.60.0050.00316.98
8.0.50.0040.00416.82
8.0.30.0150.00417.10
8.0.20.0090.01017.40
8.0.10.0000.00917.05
8.0.00.0140.00516.80
7.4.330.0000.00515.07
7.4.320.0060.00016.63
7.4.300.0030.00316.46
7.4.290.0040.00416.48
7.4.280.0040.00416.49
7.4.270.0030.00516.50
7.4.260.0000.00716.62
7.4.250.0040.00416.56
7.4.240.0020.00516.47
7.4.230.0000.00716.69
7.4.220.0190.01216.43
7.4.210.0060.01216.60
7.4.200.0070.00016.50
7.4.160.0130.00616.46
7.4.150.0080.01117.40
7.4.140.0040.01417.86
7.4.130.0140.00616.61
7.4.120.0110.00716.71
7.4.110.0180.00416.61
7.4.100.0110.00616.45
7.4.90.0130.00616.60
7.4.80.0060.01219.39
7.4.70.0130.00316.51
7.4.60.0100.00616.41
7.4.50.0050.00316.54
7.4.40.0120.00616.28
7.4.30.0100.00616.51
7.4.00.0100.00414.96
7.3.330.0030.00313.21
7.3.320.0030.00313.24
7.3.310.0070.00016.47
7.3.300.0000.00716.28
7.3.290.0030.01016.30
7.3.280.0070.00916.37
7.3.270.0140.00517.40
7.3.260.0070.01016.41
7.3.240.0160.00316.43
7.3.230.0070.01016.57
7.3.210.0120.00316.38
7.3.200.0070.01419.39
7.3.190.0130.00916.40
7.3.180.0110.01116.51
7.3.170.0140.00716.56
7.3.160.0090.00716.50
7.3.120.0100.00714.99
7.3.110.0070.01015.10
7.3.100.0060.00614.77
7.3.90.0070.01114.97
7.3.80.0070.00715.02
7.3.70.0090.00614.71
7.3.60.0030.00614.78
7.3.50.0130.00314.78
7.3.40.0000.01414.96
7.3.30.0070.01114.71
7.3.20.0090.00016.76
7.3.10.0090.00316.80
7.3.00.0050.00516.63
7.2.330.0060.01216.68
7.2.320.0060.01616.70
7.2.310.0030.01416.73
7.2.300.0040.01316.63
7.2.290.0120.00916.79
7.2.250.0090.00915.11
7.2.240.0060.01215.19
7.2.230.0060.01214.76
7.2.220.0000.01915.16
7.2.210.0000.01314.72
7.2.200.0080.00514.67
7.2.190.0030.00615.14
7.2.180.0040.01214.97
7.2.170.0080.00615.06
7.2.00.0060.00619.53
7.1.330.0060.00915.77
7.1.320.0030.01016.01
7.1.310.0100.00315.61
7.1.300.0030.00615.77
7.1.290.0030.00615.55
7.1.280.0090.00615.71
7.1.270.0040.00715.49
7.1.260.0040.01115.55
7.1.100.0030.01318.07
7.1.70.0030.00716.87
7.1.60.0070.01719.40
7.1.50.0070.01616.93
7.1.00.0100.06722.57
7.0.200.0040.00716.79
7.0.140.0100.06722.01
7.0.110.0070.08020.05
7.0.100.0030.07019.88
7.0.90.0030.04320.03
7.0.80.0070.07719.99
7.0.70.0070.07320.02
7.0.60.0030.07019.99
7.0.50.0070.03319.93
7.0.40.0000.04019.87
7.0.30.0030.08719.82
7.0.20.0000.07019.70
7.0.10.0030.05719.69
7.0.00.0000.08319.85
5.6.260.0100.02720.59
5.6.250.0030.08320.88
5.6.240.0230.05320.67
5.6.230.0070.08020.85
5.6.220.0070.06720.65
5.6.210.0070.04020.68
5.6.200.0030.04020.65
5.6.190.0170.06320.71
5.6.180.0100.08020.66
5.6.170.0100.07020.63
5.6.160.0100.07320.55
5.6.150.0030.08720.56
5.6.140.0100.07020.55
5.6.130.0100.07320.55
5.6.120.0030.05720.55
5.6.110.0100.04020.60
5.6.100.0100.09020.46
5.6.90.0130.07320.60
5.6.80.0070.07719.95
5.6.70.0100.06020.00
5.6.60.0000.07719.99
5.6.50.0070.07719.86
5.6.40.0030.06019.95
5.6.30.0030.08020.21
5.6.20.0100.07320.04
5.6.10.0100.07020.06
5.6.00.0100.03719.92
5.5.380.0100.06017.57
5.5.370.0070.07717.59
5.5.360.0030.06717.67
5.5.350.0070.08017.63
5.5.340.0030.07318.05
5.5.330.0070.08017.93
5.5.320.0070.05718.05
5.5.310.0100.06317.91
5.5.300.0000.08317.83
5.5.290.0030.08718.10
5.5.280.0100.07718.06
5.5.270.0130.07718.09
5.5.260.0100.07718.22
5.5.250.0000.08317.65
5.5.240.0170.06017.62
5.5.230.0030.08017.48
5.5.220.0200.05317.21
5.5.210.0070.06717.21
5.5.200.0070.07317.18
5.5.190.0100.07317.57
5.5.180.0070.07317.44
5.5.160.0070.04317.29
5.5.150.0030.08717.28
5.5.140.0070.07317.48
5.5.130.0000.08717.42
5.5.120.0100.07717.48
5.5.110.0030.05717.39
5.5.100.0100.07017.34
5.5.90.0070.07017.18
5.5.80.0100.07717.21
5.5.70.0130.06317.07
5.5.60.0130.07017.48
5.5.50.0070.06717.20
5.5.40.0000.07017.30
5.5.30.0100.03317.46
5.5.20.0130.08017.16
5.5.10.0030.06717.34
5.5.00.0170.07017.37
5.4.450.0070.06719.61
5.4.440.0130.07019.63
5.4.430.0130.07019.32
5.4.420.0070.07719.46
5.4.410.0100.07019.18
5.4.400.0130.07718.98
5.4.390.0070.07719.21
5.4.380.0100.07319.20
5.4.370.0130.06719.11
5.4.360.0030.06019.11
5.4.350.0130.07018.94
5.4.340.0030.06019.14
5.4.320.0030.06718.98
5.4.310.0170.07019.16
5.4.300.0100.07719.16
5.4.290.0070.04719.04
5.4.280.0070.04719.20
5.4.270.0070.08019.02
5.4.260.0000.08319.03
5.4.250.0030.04319.16
5.4.240.0070.07319.19
5.4.230.0130.06318.95
5.4.220.0100.07319.02
5.4.210.0030.05718.99
5.4.200.0100.07019.04
5.4.190.0030.07018.93
5.4.180.0000.07319.27
5.4.170.0070.07319.29
5.4.160.0070.06718.92
5.4.150.0070.04018.96
5.4.140.0070.06016.30
5.4.130.0030.04716.53
5.4.120.0070.02716.43
5.4.110.0030.03316.56
5.4.100.0070.06016.46
5.4.90.0030.07316.57
5.4.80.0000.07316.51
5.4.70.0030.03016.36
5.4.60.0070.04016.55
5.4.50.0100.07016.32
5.4.40.0100.07316.36
5.4.30.0000.07716.59
5.4.20.0070.06716.25
5.4.10.0130.06016.40
5.4.00.0070.06716.00
5.3.290.0130.07314.54
5.3.280.0070.07014.55
5.3.270.0030.04314.55
5.3.260.0030.08014.70
5.3.250.0030.04014.51
5.3.240.0000.03714.68
5.3.230.0070.08014.46
5.3.220.0100.07714.48
5.3.210.0070.07014.45
5.3.200.0030.06714.56
5.3.190.0070.03014.64
5.3.180.0030.03314.43
5.3.170.0100.07014.45
5.3.160.0130.06714.44
5.3.150.0030.07714.43
5.3.140.0100.06714.35
5.3.130.0100.06314.57
5.3.120.0030.07314.47
5.3.110.0030.08314.34
5.3.100.0030.04713.91
5.3.90.0030.07714.04
5.3.80.0030.07714.04
5.3.70.0130.06313.95
5.3.60.0030.06313.89
5.3.50.0130.07013.73
5.3.40.0100.06713.80
5.3.30.0130.06713.93
5.3.20.0130.06313.61
5.3.10.0030.08313.73
5.3.00.0000.04713.65
5.2.170.0030.06311.08
5.2.160.0070.05311.07
5.2.150.0070.03311.07
5.2.140.0000.04711.02
5.2.130.0100.05711.04
5.2.120.0070.06011.00
5.2.110.0030.05310.90
5.2.100.0030.03311.04
5.2.90.0070.06011.04
5.2.80.0130.05311.03
5.2.70.0100.04711.11
5.2.60.0030.04311.04
5.2.50.0170.05010.90
5.2.40.0000.06310.89
5.2.30.0070.06010.91
5.2.20.0030.03710.88
5.2.10.0070.05711.01
5.2.00.0030.04310.70
5.1.60.0000.05010.24
5.1.50.0170.0439.94
5.1.40.0030.0509.91
5.1.30.0000.06010.57
5.1.20.0100.05310.57
5.1.10.0100.02710.05
5.1.00.0100.0479.97
5.0.50.0100.0409.75
5.0.40.0000.0479.75
5.0.30.0030.0639.75
5.0.20.0000.0439.75
5.0.10.0130.0339.75
5.0.00.0030.0409.75
4.4.90.0000.0239.75
4.4.80.0070.0139.75
4.4.70.0000.0209.75
4.4.60.0000.0379.75
4.4.50.0070.0309.75
4.4.40.0000.0539.75
4.4.30.0000.0239.75
4.4.20.0000.0309.75
4.4.10.0070.0379.75
4.4.00.0000.0539.75
4.3.110.0030.0339.75
4.3.100.0000.0409.75
4.3.90.0070.0339.75
4.3.80.0030.0239.75
4.3.70.0000.0279.75
4.3.60.0030.0179.75
4.3.50.0000.0409.75
4.3.40.0000.0439.75
4.3.30.0000.0339.75
4.3.20.0070.0279.75
4.3.10.0070.0309.75
4.3.00.0030.0339.75

preferences:
43.47 ms | 401 KiB | 5 Q