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) { echo $key . "\n"; } 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.0090.00618.43
8.3.50.0130.00522.93
8.3.40.0120.00318.61
8.3.30.0130.00718.79
8.3.20.0050.00320.18
8.3.10.0040.00423.66
8.3.00.0050.00317.46
8.2.180.0090.00916.63
8.2.170.0110.00422.96
8.2.160.0100.00320.35
8.2.150.0000.00824.18
8.2.140.0000.00824.66
8.2.130.0110.00726.16
8.2.120.0040.00421.01
8.2.110.0040.00422.21
8.2.100.0040.00817.91
8.2.90.0060.00319.07
8.2.80.0030.00617.97
8.2.70.0040.00417.63
8.2.60.0090.00017.80
8.2.50.0080.00318.07
8.2.40.0000.00918.28
8.2.30.0070.00018.09
8.2.20.0070.00017.62
8.2.10.0040.00418.13
8.2.00.0000.00717.75
8.1.280.0070.00725.92
8.1.270.0040.00423.75
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0060.00323.97
8.1.230.0050.00519.01
8.1.220.0040.00417.74
8.1.210.0090.00018.77
8.1.200.0070.00317.35
8.1.190.0040.00417.23
8.1.180.0080.00018.10
8.1.170.0040.00418.53
8.1.160.0040.00421.88
8.1.150.0070.00018.92
8.1.140.0070.00017.48
8.1.130.0000.00717.83
8.1.120.0000.00717.43
8.1.110.0040.00417.45
8.1.100.0040.00417.48
8.1.90.0070.00417.37
8.1.80.0040.00417.39
8.1.70.0030.00317.45
8.1.60.0030.00617.51
8.1.50.0030.00517.56
8.1.40.0040.00417.55
8.1.30.0000.00817.62
8.1.20.0000.01017.71
8.1.10.0040.00417.53
8.1.00.0000.00817.50
8.0.300.0070.00018.77
8.0.290.0040.00416.75
8.0.280.0000.00718.45
8.0.270.0000.00717.24
8.0.260.0070.00017.25
8.0.250.0030.00317.03
8.0.240.0000.00717.05
8.0.230.0090.00017.03
8.0.220.0050.00217.00
8.0.210.0030.00316.93
8.0.200.0060.00016.88
8.0.190.0060.00317.02
8.0.180.0000.00716.86
8.0.170.0050.00316.99
8.0.160.0040.00416.88
8.0.150.0040.00416.89
8.0.140.0000.00716.79
8.0.130.0000.00513.41
8.0.120.0040.00416.95
8.0.110.0050.00316.93
8.0.100.0000.00816.98
8.0.90.0040.00416.93
8.0.80.0070.01016.83
8.0.70.0000.00716.81
8.0.60.0040.00416.98
8.0.50.0040.00417.02
8.0.30.0110.00817.12
8.0.20.0110.00917.40
8.0.10.0050.00317.10
8.0.00.0070.01316.76
7.4.330.0050.00015.07
7.4.320.0000.00616.61
7.4.300.0030.00316.43
7.4.290.0000.00716.61
7.4.280.0040.00416.63
7.4.270.0070.00016.61
7.4.260.0070.00016.60
7.4.250.0000.00816.47
7.4.240.0020.00516.48
7.4.230.0000.00816.36
7.4.220.0060.01216.52
7.4.210.0070.01016.47
7.4.200.0050.00216.50
7.4.160.0060.01616.43
7.4.150.0330.02317.40
7.4.140.0110.01017.86
7.4.130.0150.00916.50
7.4.120.0100.00816.47
7.4.110.0130.01016.32
7.4.100.0120.00616.67
7.4.90.0110.00816.51
7.4.80.0070.01519.39
7.4.70.0130.00916.75
7.4.60.0030.01416.55
7.4.50.0000.00716.36
7.4.40.0060.00916.47
7.4.30.0060.00916.32
7.4.10.0070.01114.89
7.4.00.0070.01014.92
7.3.330.0030.00413.29
7.3.320.0020.00213.22
7.3.310.0030.00316.39
7.3.300.0000.00716.32
7.3.290.0100.00616.34
7.3.280.0080.00916.38
7.3.270.0110.00817.40
7.3.260.0110.00716.35
7.3.240.0190.00416.38
7.3.230.0090.00616.64
7.3.210.0140.00316.42
7.3.200.0190.00319.39
7.3.190.0050.01116.35
7.3.180.0040.01216.52
7.3.170.0150.00616.44
7.3.160.0110.01016.50
7.3.130.0140.00415.13
7.3.120.0060.01214.84
7.3.110.0100.00614.95
7.3.100.0000.01814.89
7.3.90.0100.00314.84
7.3.80.0110.00414.75
7.3.70.0070.01014.89
7.3.60.0060.00914.48
7.3.50.0060.00614.60
7.3.40.0080.00814.92
7.3.30.0040.00414.88
7.3.20.0060.00916.68
7.3.10.0060.00916.56
7.3.00.0090.00716.58
7.2.330.0090.01516.73
7.2.320.0120.00816.68
7.2.310.0090.00916.51
7.2.300.0170.00716.80
7.2.290.0060.01616.75
7.2.260.0140.00314.98
7.2.250.0080.00815.23
7.2.240.0000.01215.05
7.2.230.0130.00715.09
7.2.220.0060.01214.98
7.2.210.0110.00314.98
7.2.200.0130.00314.96
7.2.190.0070.01014.98
7.2.180.0030.00615.07
7.2.170.0060.00315.11
7.2.160.0030.01215.05
7.2.150.0030.01016.93
7.2.140.0040.00816.87
7.2.130.0050.01016.87
7.2.120.0030.01216.79
7.2.110.0050.00616.78
7.2.100.0030.01016.85
7.2.90.0070.00716.89
7.2.80.0060.00516.83
7.2.70.0060.01116.82
7.2.60.0060.00916.88
7.2.50.0060.00716.77
7.2.40.0060.00716.95
7.2.30.0080.00716.95
7.2.20.0050.00716.81
7.2.10.0050.01016.88
7.2.00.0040.00916.92
7.1.330.0000.01415.91
7.1.320.0030.00615.80
7.1.310.0000.00915.89
7.1.300.0070.00715.79
7.1.290.0000.01215.79
7.1.280.0150.00015.82
7.1.270.0030.01315.71
7.1.260.0000.01115.85
7.1.250.0050.00715.83
7.1.240.0040.01115.60
7.1.230.0000.00815.71
7.1.220.0000.01215.64
7.1.210.0100.00715.84
7.1.200.0000.01215.68
7.1.190.0030.00915.59
7.1.180.0040.01215.96
7.1.170.0090.00615.79
7.1.160.0000.01115.83
7.1.150.0050.00515.77
7.1.140.0070.00415.86
7.1.130.0030.01015.83
7.1.120.0070.00715.69
7.1.110.0070.00715.99
7.1.100.0010.01117.07
7.1.90.0090.00415.86
7.1.80.0070.00416.04
7.1.70.0050.00516.46
7.1.60.0110.00917.46
7.1.50.0090.00916.27
7.1.40.0030.00915.75
7.1.30.0030.00715.57
7.1.20.0070.00716.00
7.1.10.0030.01015.94
7.1.00.0050.03919.06
7.0.330.0040.00815.30
7.0.320.0060.00915.51
7.0.310.0040.00415.38
7.0.300.0070.00715.29
7.0.290.0040.00415.45
7.0.280.0000.01215.58
7.0.270.0070.00715.49
7.0.260.0060.00615.49
7.0.250.0070.00715.56
7.0.240.0110.00315.38
7.0.230.0030.00615.31
7.0.220.0040.01115.37
7.0.210.0040.01115.50
7.0.200.0030.01216.18
7.0.190.0040.00415.66
7.0.180.0030.00915.34
7.0.170.0150.00015.39
7.0.160.0030.01015.25
7.0.150.0030.00915.54
7.0.140.0080.03618.77
7.0.130.0090.00315.51
7.0.120.0030.01315.32
7.0.110.0040.00415.55
7.0.100.0030.00615.55
7.0.90.0090.00615.26
7.0.80.0070.00715.25
7.0.70.0030.01215.39
7.0.60.0100.04017.66
7.0.50.0060.04316.78
7.0.40.0080.03016.91
7.0.30.0120.02316.81
7.0.20.0130.02416.73
7.0.10.0020.04116.85
7.0.00.0100.04316.77
5.6.400.0030.00614.63
5.6.390.0080.00314.27
5.6.380.0070.00714.63
5.6.370.0040.00814.14
5.6.360.0070.00714.45
5.6.350.0030.01214.35
5.6.340.0030.01414.66
5.6.330.0000.00914.34
5.6.320.0090.00614.13
5.6.310.0070.00714.13
5.6.300.0070.00314.69
5.6.290.0000.01114.20
5.6.280.0090.03617.82
5.6.270.0100.00714.47
5.6.260.0090.00614.37
5.6.250.0040.00414.62
5.6.240.0030.01014.30
5.6.230.0090.00014.27
5.6.220.0060.00914.44
5.6.210.0030.03817.31
5.6.200.0070.04216.29
5.6.190.0040.02917.53
5.6.180.0140.02517.31
5.6.170.0210.03817.44
5.6.160.0050.04717.31
5.6.150.0050.04316.22
5.6.140.0060.02416.31
5.6.130.0050.02916.24
5.6.120.0060.03517.65
5.6.110.0080.04617.60
5.6.100.0060.03817.71
5.6.90.0060.03917.71
5.6.80.0060.02117.38
5.6.70.0110.00814.11
5.6.60.0070.00314.26
5.6.50.0030.01014.05
5.6.40.0030.01314.16
5.6.30.0030.01314.07
5.6.20.0100.00714.34
5.6.10.0040.00814.36
5.6.00.0070.00714.20
5.5.380.0100.00314.51
5.5.370.0030.01314.43
5.5.360.0080.00314.29
5.5.350.0220.03217.42
5.5.340.0150.01616.19
5.5.330.0110.04217.39
5.5.320.1670.02317.38
5.5.310.0130.02417.30
5.5.300.0060.03416.13
5.5.290.0020.02516.05
5.5.280.0080.03817.52
5.5.270.0050.04517.57
5.5.260.0060.02617.66
5.5.250.0050.02417.47
5.5.240.0070.04217.24
5.5.230.0090.00614.29
5.5.220.0030.00714.08
5.5.210.0030.01014.37
5.5.200.0040.01414.05
5.5.190.0070.01014.42
5.5.180.0080.00414.24
5.5.170.0000.01313.86
5.5.160.0000.01014.08
5.5.150.0060.01214.03
5.5.140.0060.00614.17
5.5.130.0040.00414.43
5.5.120.0030.00714.25
5.5.110.0070.00714.22
5.5.100.0000.01114.23
5.5.90.0040.00713.96
5.5.80.0080.00313.94
5.5.70.0060.00914.20
5.5.60.0110.00414.03
5.5.50.0070.00714.38
5.5.40.0000.01314.32
5.5.30.0000.00914.23
5.5.20.0030.00514.31
5.5.10.0030.00814.39
5.5.00.0100.00314.09
5.4.450.0220.03516.22
5.4.440.0070.03216.39
5.4.430.0100.02816.30
5.4.420.0080.02716.38
5.4.410.0100.02516.32
5.4.400.0100.02816.29
5.4.390.0120.02416.11
5.4.380.0090.02915.90
5.4.370.0080.02315.87
5.4.360.0100.02516.01
5.4.350.0080.02412.63
5.4.340.0110.05112.63
5.4.330.0090.00313.23
5.4.320.0080.01912.88
5.4.310.0040.02312.88
5.4.300.0040.02012.88
5.4.290.0080.01912.87
5.4.280.0040.02112.82
5.4.270.0030.02212.82
5.4.260.0070.01912.82
5.4.250.0060.02212.82
5.4.240.0050.02112.82
5.4.230.0060.02012.82
5.4.220.0040.02112.82
5.4.210.0020.02512.82
5.4.200.0040.02112.82
5.4.190.0040.02312.82
5.4.180.0060.01812.81
5.4.170.0030.02312.82
5.4.160.0020.02112.82
5.4.150.0050.02212.81
5.4.140.0040.02012.66
5.4.130.0050.01812.65
5.4.120.0020.02312.63
5.4.110.0070.02212.63
5.4.100.0040.02012.63
5.4.90.0060.02212.63
5.4.80.0070.01912.63
5.4.70.0040.01912.63
5.4.60.0050.02012.63
5.4.50.0070.01912.63
5.4.40.0060.02012.62
5.4.30.0030.02312.62
5.4.20.0040.02212.62
5.4.10.0030.02112.62
5.4.00.0020.02212.37
5.3.290.0030.04112.80
5.3.280.0080.03612.70
5.3.270.0060.05512.72
5.3.260.0080.04412.71
5.3.250.0080.03612.72
5.3.240.0060.03712.72
5.3.230.0050.03812.71
5.3.220.0070.03612.68
5.3.210.0060.03912.68
5.3.200.0040.03912.68
5.3.190.0090.03412.68
5.3.180.0090.03412.68
5.3.170.0060.03612.67
5.3.160.0040.03812.68
5.3.150.0040.03912.67
5.3.140.0060.03612.66
5.3.130.0090.03512.66
5.3.120.0050.03912.66
5.3.110.0040.04012.66
5.3.100.0120.03012.12
5.3.90.0050.03712.08
5.3.80.0050.03512.08
5.3.70.0060.03512.07
5.3.60.0080.03412.06
5.3.50.0040.03712.00
5.3.40.0040.04312.00
5.3.30.0050.03511.95
5.3.20.0090.03111.72
5.3.10.0080.03311.70
5.3.00.0060.03611.68
5.2.170.0040.0319.18
5.2.160.0090.0259.18
5.2.150.0070.0289.18
5.2.140.0030.0329.17
5.2.130.0040.0299.14
5.2.120.0040.0289.14
5.2.110.0050.0289.14
5.2.100.0050.0289.14
5.2.90.0070.0269.14
5.2.80.0070.0289.14
5.2.70.0080.0279.14
5.2.60.0020.0339.09
5.2.50.0060.0289.05
5.2.40.0050.0279.03
5.2.30.0050.0299.01
5.2.20.0070.0269.00
5.2.10.0040.0288.93
5.2.00.0080.0258.79
5.1.60.0030.0258.07
5.1.50.0060.0238.07
5.1.40.0050.0228.04
5.1.30.0050.0248.40
5.1.20.0080.0228.42
5.1.10.0070.0228.14
5.1.00.0030.0268.14
5.0.50.0060.0176.62
5.0.40.0070.0156.48
5.0.30.0050.0296.30
5.0.20.0020.0206.27
5.0.10.0030.0206.24
5.0.00.0020.0316.23
4.4.90.0070.0114.78
4.4.80.0060.0114.75
4.4.70.0050.0134.76
4.4.60.0020.0164.75
4.4.50.0050.0134.77
4.4.40.0010.0264.71
4.4.30.0000.0184.76
4.4.20.0010.0174.84
4.4.10.0030.0154.85
4.4.00.0030.0244.76
4.3.110.0020.0164.67
4.3.100.0020.0154.66
4.3.90.0050.0124.63
4.3.80.0010.0264.59
4.3.70.0030.0144.63
4.3.60.0030.0144.63
4.3.50.0030.0154.63
4.3.40.0030.0234.54
4.3.30.0020.0163.28
4.3.20.0010.0173.25
4.3.10.0010.0163.22
4.3.00.0170.0177.12

preferences:
44.39 ms | 401 KiB | 5 Q