3v4l.org

run code in 300+ PHP versions simultaneously
<?php $custom_fields = [ 'foo' => '17', ]; $time_intervals = ['day', 'month', 'year', 'hour', 'minute', 'period']; $data = [ 'fooday' => '17', 'foomonth' => 'March', 'name' => 'Chris' ]; function array_string_multiply($array1, $array2) { foreach ($array1 as $field) { yield array_map(function ($interval) use ($field) { return $field . $interval; }, $array2); } } 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.0060.00918.42
8.3.50.0140.00622.82
8.3.40.0110.00418.79
8.3.30.0030.01118.96
8.3.20.0040.00420.14
8.3.10.0040.00423.66
8.3.00.0040.00419.25
8.2.180.0130.01016.63
8.2.170.0110.00722.96
8.2.160.0100.00320.52
8.2.150.0030.00524.18
8.2.140.0050.00324.66
8.2.130.0130.00726.16
8.2.120.0050.00320.89
8.2.110.0040.00420.42
8.2.100.0000.01217.91
8.2.90.0040.00419.08
8.2.80.0040.00417.97
8.2.70.0040.00417.63
8.2.60.0050.00317.93
8.2.50.0040.00418.07
8.2.40.0060.00318.09
8.2.30.0000.00718.15
8.2.20.0080.00017.70
8.2.10.0040.00418.02
8.2.00.0000.00817.86
8.1.280.0140.00725.92
8.1.270.0070.00323.75
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0130.01022.52
8.1.230.0040.00820.95
8.1.220.0050.00318.77
8.1.210.0030.00518.79
8.1.200.0090.00017.50
8.1.190.0050.00317.11
8.1.180.0080.00018.10
8.1.170.0000.00818.53
8.1.160.0000.00721.93
8.1.150.0000.00818.86
8.1.140.0050.00317.51
8.1.130.0000.00717.84
8.1.120.0000.00717.54
8.1.110.0030.00517.36
8.1.100.0040.00417.48
8.1.90.0100.00017.39
8.1.80.0070.00017.43
8.1.70.0050.00317.41
8.1.60.0090.00017.45
8.1.50.0050.00317.43
8.1.40.0080.00017.52
8.1.30.0050.00317.50
8.1.20.0040.00417.66
8.1.10.0000.00717.52
8.1.00.0040.00417.29
8.0.300.0040.00419.98
8.0.290.0020.00516.75
8.0.280.0080.00018.45
8.0.270.0070.00017.19
8.0.260.0000.00617.26
8.0.250.0000.00716.80
8.0.240.0030.00316.98
8.0.230.0060.00316.83
8.0.220.0030.00316.75
8.0.210.0040.00416.93
8.0.200.0000.00716.88
8.0.190.0040.00416.94
8.0.180.0050.00316.91
8.0.170.0000.00916.83
8.0.160.0040.00416.91
8.0.150.0000.00716.87
8.0.140.0040.00416.80
8.0.130.0060.00013.31
8.0.120.0000.00816.87
8.0.110.0040.00416.89
8.0.100.0040.00416.77
8.0.90.0040.00416.91
8.0.80.0120.00316.93
8.0.70.0000.00716.68
8.0.60.0050.00216.75
8.0.50.0000.00716.84
8.0.30.0120.01216.85
8.0.20.0150.01117.40
8.0.10.0070.00016.89
8.0.00.0110.00916.82
7.4.330.0050.00015.00
7.4.320.0030.00316.61
7.4.300.0000.00716.51
7.4.290.0030.00316.61
7.4.280.0000.00816.48
7.4.270.0070.00016.49
7.4.260.0030.00316.35
7.4.250.0050.00316.46
7.4.240.0020.00516.49
7.4.230.0000.00716.40
7.4.220.0120.00616.52
7.4.210.0030.01216.60
7.4.200.0000.00716.59
7.4.160.0140.00716.61
7.4.150.0160.00817.40
7.4.140.0100.00817.86
7.4.130.0120.00616.67
7.4.120.0090.01116.64
7.4.110.0120.00616.33
7.4.100.0090.00916.36
7.4.90.0150.00316.58
7.4.80.0120.00619.39
7.4.70.0110.00616.59
7.4.60.0040.01116.59
7.4.50.0030.00616.63
7.4.40.0100.00716.63
7.4.30.0100.00616.31
7.4.00.0070.00714.89
7.3.330.0000.00613.30
7.3.320.0000.00513.11
7.3.310.0030.00316.39
7.3.300.0030.00316.21
7.3.290.0040.01416.19
7.3.280.0080.01016.30
7.3.270.0090.00917.40
7.3.260.0060.01216.50
7.3.240.0040.01716.34
7.3.230.0090.00916.39
7.3.210.0060.01016.36
7.3.200.0130.00319.39
7.3.190.0160.00316.34
7.3.180.0030.01216.64
7.3.170.0130.00316.53
7.3.160.0140.00816.40
7.3.10.0130.00316.49
7.3.00.0030.00816.56
7.2.330.0100.01016.42
7.2.320.0100.01216.78
7.2.310.0060.01216.73
7.2.300.0130.00316.72
7.2.290.0180.00616.79
7.2.130.0060.00616.38
7.2.120.0060.00916.71
7.2.110.0030.01216.54
7.2.100.0090.00916.68
7.2.90.0130.00616.28
7.2.80.0160.00016.62
7.2.70.0060.00616.64
7.2.60.0130.00716.40
7.2.50.0060.01816.33
7.2.40.0160.00416.50
7.2.30.0200.00716.74
7.2.20.0150.00616.57
7.2.10.0030.01416.80
7.2.00.0100.00918.16
7.1.250.0100.00615.22
7.1.100.0030.00718.15
7.1.70.0080.00417.26
7.1.60.0070.01619.40
7.1.50.0100.01016.97
7.1.00.0070.07322.57
7.0.200.0070.00416.91
7.0.140.0030.07022.07
7.0.60.0100.08319.93
7.0.50.0030.08017.88
7.0.40.0130.07020.01
7.0.30.0230.05320.30
7.0.20.0500.07320.25
7.0.10.0170.08020.25
7.0.00.0070.05320.24
5.6.280.0000.07721.00
5.6.210.0030.08320.55
5.6.200.0030.08318.22
5.6.190.0030.09020.61
5.6.180.0170.04320.64
5.6.170.0200.07020.56
5.6.160.0070.05020.53
5.6.150.0230.03318.23
5.6.140.0030.04318.23
5.6.130.0030.04018.23
5.6.120.0000.08721.13
5.6.110.0130.08021.14
5.6.100.0130.08020.97
5.6.90.0030.05721.00
5.6.80.0070.07020.39
5.5.350.4300.04020.41
5.5.340.0230.06717.98
5.5.330.0070.05020.48
5.5.320.0300.04720.36
5.5.310.0170.08320.20
5.5.300.0030.08717.98
5.5.290.0000.04317.96
5.5.280.0130.04020.86
5.5.270.0000.05720.73
5.5.260.0030.07720.98
5.5.250.0070.04720.46
5.5.240.0070.07320.13
5.4.450.0970.05019.63
5.4.440.0830.05019.64
5.4.430.0900.05719.48
5.4.420.0800.06019.27
5.4.410.0930.04319.41
5.4.400.0670.05019.32
5.4.390.0800.06719.12
5.4.380.0200.05018.63
5.4.370.0100.03718.45
5.4.360.0070.03718.70
5.4.350.0030.04912.03
5.4.340.0140.08612.03
5.4.320.0050.03912.52
5.4.310.0040.04212.51
5.4.300.0080.04712.52
5.4.290.0070.04112.51
5.4.280.0080.03512.41
5.4.270.0060.03712.41
5.4.260.0050.04112.41
5.4.250.0100.03612.41
5.4.240.0070.03512.41
5.4.230.0070.05212.40
5.4.220.0100.04812.40
5.4.210.0090.04712.40
5.4.200.0070.04112.40
5.4.190.0080.03612.40
5.4.180.0050.03712.40
5.4.170.0090.03312.40
5.4.160.0090.03312.40
5.4.150.0070.03512.40
5.4.140.0060.03712.09
5.4.130.0060.03512.07
5.4.120.0050.03912.04
5.4.110.0060.03612.03
5.4.100.0050.03512.03
5.4.90.0060.03712.03
5.4.80.0040.03812.03
5.4.70.0040.03612.02
5.4.60.0040.03612.03
5.4.50.0040.03712.03
5.4.40.0070.04912.02
5.4.30.0080.03612.01
5.4.20.0070.03412.01
5.4.10.0060.03412.01
5.4.00.0050.03711.50
5.3.290.0070.04112.80
5.3.280.0050.03812.71
5.3.270.0070.04012.72
5.3.260.0080.05012.72
5.3.250.0030.04012.72
5.3.240.0060.03612.72
5.3.230.0040.04012.71
5.3.220.0050.03912.68
5.3.210.0050.04312.68
5.3.200.0080.03612.68
5.3.190.0040.03912.67
5.3.180.0080.05212.68
5.3.170.0050.03812.67
5.3.160.0060.04112.68
5.3.150.0070.03612.68
5.3.140.0060.03712.66
5.3.130.0100.04612.66
5.3.120.0070.03912.65
5.3.110.0050.04112.66
5.3.100.0050.03812.12
5.3.90.0080.03512.08
5.3.80.0060.03912.07
5.3.70.0110.03212.07
5.3.60.0070.03612.07
5.3.50.0090.03312.00
5.3.40.0080.04612.00
5.3.30.0060.03811.95
5.3.20.0050.03511.72
5.3.10.0070.03311.70
5.3.00.0040.03811.68
5.2.170.0050.0299.18
5.2.160.0050.0289.18
5.2.150.0040.0309.18
5.2.140.0040.0319.18
5.2.130.0050.0299.14
5.2.120.0030.0309.14
5.2.110.0050.0289.15
5.2.100.0060.0279.14
5.2.90.0050.0289.14
5.2.80.0060.0379.14
5.2.70.0030.0429.14
5.2.60.0080.0419.09
5.2.50.0050.0309.05
5.2.40.0070.0269.03
5.2.30.0030.0319.01
5.2.20.0050.0299.01
5.2.10.0030.0318.93
5.2.00.0060.0298.79
5.1.60.0030.0258.07
5.1.50.0060.0238.06
5.1.40.0060.0358.05
5.1.30.0020.0298.40
5.1.20.0040.0328.41
5.1.10.0040.0268.14
5.1.00.0040.0258.14
5.0.50.0020.0226.62
5.0.40.0050.0276.48
5.0.30.0010.0336.29
5.0.20.0020.0216.26
5.0.10.0020.0216.24
5.0.00.0040.0306.23
4.4.90.0010.0174.78
4.4.80.0050.0194.75
4.4.70.0020.0154.75
4.4.60.0050.0134.75
4.4.50.0030.0154.77
4.4.40.0000.0284.71
4.4.30.0040.0184.76
4.4.20.0000.0194.85
4.4.10.0010.0174.85
4.4.00.0050.0224.76
4.3.110.0040.0144.67
4.3.100.0020.0154.66
4.3.90.0040.0134.64
4.3.80.0030.0244.59
4.3.70.0030.0144.63
4.3.60.0030.0144.63
4.3.50.0020.0154.63
4.3.40.0020.0254.54
4.3.30.0020.0163.28
4.3.20.0030.0153.26
4.3.10.0020.0153.22
4.3.00.0130.0208.44

preferences:
52.03 ms | 401 KiB | 5 Q