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($array1, $array2) { $values = []; foreach ($array1 as $field) { $values = array_merge($values, array_map(function ($interval) use ($field) { return $field . $interval; }, $array2)); } return $values; } 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.70.0000.01816.58
8.3.60.0110.00418.30
8.3.50.0140.00622.86
8.3.40.0070.00718.87
8.3.30.0070.01019.09
8.3.20.0080.00020.24
8.3.10.0040.00423.65
8.3.00.0040.00419.25
8.2.180.0140.00416.50
8.2.170.0190.00322.96
8.2.160.0030.01020.39
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0090.00626.16
8.2.120.0000.00821.03
8.2.110.0040.01719.27
8.2.100.0090.00317.78
8.2.90.0040.00417.88
8.2.80.0080.00018.79
8.2.70.0040.00417.93
8.2.60.0090.00517.80
8.2.50.0000.01118.10
8.2.40.0040.00420.47
8.2.30.0040.00417.99
8.2.20.0040.00417.69
8.2.10.0050.00218.06
8.2.00.0090.00017.66
8.1.280.0100.00325.92
8.1.270.0040.00423.91
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0060.00320.93
8.1.230.0040.00717.70
8.1.220.0070.00317.77
8.1.210.0090.00018.77
8.1.200.0070.00417.25
8.1.190.0060.00317.43
8.1.180.0000.00818.10
8.1.170.0040.00418.66
8.1.160.0040.00422.13
8.1.150.0040.00418.81
8.1.140.0060.00317.44
8.1.130.0050.00217.71
8.1.120.0050.00317.48
8.1.110.0040.00417.39
8.1.100.0070.00017.37
8.1.90.0070.00317.32
8.1.80.0030.00317.52
8.1.70.0030.00517.43
8.1.60.0060.00317.61
8.1.50.0040.00417.43
8.1.40.0050.00317.48
8.1.30.0000.00817.67
8.1.20.0030.00617.67
8.1.10.0040.00417.50
8.1.00.0040.00417.45
8.0.300.0070.00718.77
8.0.290.0000.00816.75
8.0.280.0040.00418.54
8.0.270.0000.00716.76
8.0.260.0000.00717.27
8.0.250.0000.00716.93
8.0.240.0080.00016.86
8.0.230.0030.00316.82
8.0.220.0080.00016.89
8.0.210.0080.00016.86
8.0.200.0000.00617.02
8.0.190.0000.00716.98
8.0.180.0000.01316.95
8.0.170.0080.00016.92
8.0.160.0000.00716.96
8.0.150.0000.00816.90
8.0.140.0050.00316.73
8.0.130.0030.00313.31
8.0.120.0040.00416.76
8.0.110.0040.00416.90
8.0.100.0040.00416.80
8.0.90.0000.00716.94
8.0.80.0090.00616.85
8.0.70.0050.00216.78
8.0.60.0040.00416.74
8.0.50.0000.00716.88
8.0.30.0150.00816.82
8.0.20.0140.00517.40
8.0.10.0030.00516.84
8.0.00.0080.01116.99
7.4.330.0000.00515.00
7.4.320.0040.00416.41
7.4.300.0000.00616.61
7.4.290.0060.00316.50
7.4.280.0030.00516.59
7.4.270.0040.00316.51
7.4.260.0000.00716.52
7.4.250.0050.00216.47
7.4.240.0040.00416.41
7.4.230.0000.00716.54
7.4.220.0120.00616.50
7.4.210.0060.01116.63
7.4.200.0000.00716.63
7.4.160.0120.00816.32
7.4.150.0040.01617.40
7.4.140.0170.00617.86
7.4.130.0060.01416.56
7.4.120.0140.00816.54
7.4.110.0110.00716.59
7.4.100.0120.00616.58
7.4.90.0030.01616.66
7.4.80.0140.00919.39
7.4.70.0140.00716.59
7.4.60.0110.00816.46
7.4.50.0060.00316.41
7.4.40.0170.00316.51
7.4.30.0090.00616.50
7.4.00.0070.01114.86
7.3.330.0060.00013.17
7.3.320.0000.00513.23
7.3.310.0030.00316.30
7.3.300.0000.00716.17
7.3.290.0070.00716.30
7.3.280.0080.01016.28
7.3.270.0120.00917.40
7.3.260.0110.00716.60
7.3.240.0070.01416.31
7.3.230.0120.00616.66
7.3.210.0100.00716.46
7.3.200.0130.01019.39
7.3.190.0090.00816.51
7.3.180.0100.00716.59
7.3.170.0120.00616.48
7.3.160.0080.00816.30
7.3.120.0090.00917.15
7.3.110.0070.00717.15
7.3.100.0100.00717.15
7.3.90.0060.00917.15
7.3.80.0070.01017.15
7.3.70.0070.01017.15
7.3.60.0000.01717.15
7.3.50.0100.00717.15
7.3.40.0070.00317.15
7.3.30.0070.00317.15
7.3.20.0070.00717.15
7.3.10.0070.00816.80
7.3.00.0070.00616.89
7.2.330.0160.00816.84
7.2.320.0060.01216.72
7.2.310.0100.00816.46
7.2.300.0050.01116.59
7.2.290.0100.01316.69
7.2.240.0090.00317.15
7.2.230.0030.01417.15
7.2.220.0110.00417.15
7.2.210.0040.01417.15
7.2.200.0070.00417.15
7.2.190.0100.00717.15
7.2.180.0110.00417.15
7.2.170.0040.00717.15
7.2.160.0070.01017.15
7.2.150.0060.00617.15
7.2.140.0060.01017.15
7.2.130.0030.01016.95
7.2.120.0080.00617.06
7.2.110.0070.00717.03
7.2.100.0030.00717.01
7.2.90.0070.00717.06
7.2.80.0050.00517.14
7.2.70.0030.01017.08
7.2.60.0110.00517.01
7.2.50.0020.01417.12
7.2.40.0070.00517.12
7.2.30.0080.00317.05
7.2.20.0040.00716.91
7.2.10.0050.01116.97
7.2.00.0030.01117.83
7.1.330.0030.01317.15
7.1.320.0060.00917.15
7.1.310.0040.00917.15
7.1.300.0080.00417.15
7.1.290.0070.01017.15
7.1.280.0040.00817.15
7.1.270.0000.01817.15
7.1.260.0060.00917.15
7.1.250.0060.00616.57
7.1.100.0000.01118.16
7.1.70.0000.00717.19
7.1.60.0070.01719.40
7.1.50.0070.01816.98
7.1.00.0070.07022.40
7.0.200.0030.01016.82
7.0.140.0070.07022.09
7.0.60.0030.09319.79
7.0.50.0030.07018.02
7.0.40.0000.09020.14
7.0.30.0500.06320.19
7.0.20.0300.07320.24
7.0.10.0030.09320.09
7.0.00.0000.04320.22
5.6.280.0030.07321.12
5.6.210.0030.07320.57
5.6.200.0070.07018.12
5.6.190.0070.04020.52
5.6.180.4100.05020.48
5.6.170.0200.06320.40
5.6.160.0030.08720.51
5.6.150.0100.07718.27
5.6.140.0030.06018.12
5.6.130.0030.05018.12
5.6.120.0170.06721.19
5.6.110.0070.08321.00
5.6.100.0130.03020.98
5.6.90.0000.04720.94
5.6.80.0070.05720.42
5.6.70.0300.06020.42
5.5.350.0070.07720.40
5.5.340.0130.07317.95
5.5.330.0000.04720.27
5.5.320.0230.05320.36
5.5.310.0330.04720.34
5.5.300.0100.06317.95
5.5.290.0170.06717.93
5.5.280.0200.08020.98
5.5.270.0070.06320.87
5.5.260.0100.05320.77
5.5.250.0100.07320.67
5.5.240.0030.07720.36
5.4.450.0670.06019.20
5.4.440.0770.06019.36
5.4.430.0730.06319.47
5.4.420.1000.04019.52
5.4.410.0270.06019.39
5.4.400.0770.05318.95
5.4.390.0800.05019.21
5.4.380.0130.05318.73
5.4.370.0100.05718.51
5.4.360.0130.04718.70
5.4.350.0110.04412.03
5.4.340.0080.03812.02
5.4.320.0050.03612.52
5.4.310.0090.03412.51
5.4.300.0070.03412.52
5.4.290.0040.04212.51
5.4.280.0040.03712.41
5.4.270.0030.03812.41
5.4.260.0080.04112.41
5.4.250.0040.03912.40
5.4.240.0050.03712.41
5.4.230.0010.04212.40
5.4.220.0050.03612.40
5.4.210.0040.03612.40
5.4.200.0040.03912.39
5.4.190.0070.04112.39
5.4.180.0050.03612.39
5.4.170.0110.03312.40
5.4.160.0030.04212.40
5.4.150.0060.03912.39
5.4.140.0040.03912.08
5.4.130.0080.04012.07
5.4.120.0060.03612.03
5.4.110.0070.04612.02
5.4.100.0080.03512.02
5.4.90.0090.03412.02
5.4.80.0060.03712.02
5.4.70.0080.03712.02
5.4.60.0130.04312.02
5.4.50.0070.04312.01
5.4.40.0060.03612.00
5.4.30.0060.03512.00
5.4.20.0060.03512.00
5.4.10.0060.03412.00
5.4.00.0090.03211.48
5.3.290.0090.04112.80
5.3.280.0040.03912.71
5.3.270.0110.04912.73
5.3.260.0040.04112.72
5.3.250.0100.04012.72
5.3.240.0100.03612.72
5.3.230.0050.03712.70
5.3.220.0070.03512.68
5.3.210.0010.04312.68
5.3.200.0070.03512.68
5.3.190.0050.03812.68
5.3.180.0050.03812.67
5.3.170.0060.03712.67
5.3.160.0050.03712.67
5.3.150.0070.03712.67
5.3.140.0050.03912.66
5.3.130.0090.04112.66
5.3.120.0110.03412.66
5.3.110.0090.04612.66
5.3.100.0130.04912.11
5.3.90.0070.03812.08
5.3.80.0070.03712.07
5.3.70.0040.03912.07
5.3.60.0060.03712.07
5.3.50.0050.03812.00
5.3.40.0080.04212.00
5.3.30.0070.03411.95
5.3.20.0050.03611.72
5.3.10.0030.03711.70
5.3.00.0050.03611.68
5.2.170.0050.0349.18
5.2.160.0030.0299.18
5.2.150.0020.0329.18
5.2.140.0030.0339.18
5.2.130.0030.0309.14
5.2.120.0040.0289.14
5.2.110.0030.0309.15
5.2.100.0050.0309.14
5.2.90.0060.0279.14
5.2.80.0090.0269.14
5.2.70.0050.0299.14
5.2.60.0030.0309.08
5.2.50.0050.0299.05
5.2.40.0070.0269.03
5.2.30.0060.0289.01
5.2.20.0100.0289.00
5.2.10.0030.0298.92
5.2.00.0030.0298.78
5.1.60.0060.0228.07
5.1.50.0000.0288.06
5.1.40.0050.0228.05
5.1.30.0070.0338.40
5.1.20.0070.0298.42
5.1.10.0010.0288.14
5.1.00.0020.0328.14
5.0.50.0030.0206.63
5.0.40.0020.0206.48
5.0.30.0010.0336.29
5.0.20.0030.0196.26
5.0.10.0020.0226.24
5.0.00.0030.0316.23
4.4.90.0030.0184.78
4.4.80.0060.0164.75
4.4.70.0040.0194.75
4.4.60.0040.0134.75
4.4.50.0030.0154.77
4.4.40.0030.0254.71
4.4.30.0020.0154.76
4.4.20.0040.0144.84
4.4.10.0020.0164.85
4.4.00.0020.0254.76
4.3.110.0010.0174.67
4.3.100.0020.0164.66
4.3.90.0050.0124.64
4.3.80.0020.0254.59
4.3.70.0020.0154.63
4.3.60.0030.0144.63
4.3.50.0030.0144.63
4.3.40.0040.0234.54
4.3.30.0030.0153.28
4.3.20.0030.0153.26
4.3.10.0010.0173.22
4.3.00.0100.0237.21

preferences:
45.93 ms | 401 KiB | 5 Q