3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = array(15, 10, 12, 17, 21, 13, 15, 25, 7, 18, 4, 1, 5, 2); $chunks = array_chunk($arr, 3); $ids = array(); foreach ($chunks as $k => $v) { $otherIds = array(6, 7, 22, 31, 44, 9, 17); $ids = $v; foreach ($chunks as $key => $val) { if ($key <= $k) continue; foreach ($chunks[$key] as $g => $ch) { foreach ($otherIds as $o) { if ($ch['id'] == $o) { $ids[] = $o; unset($chunks[$key][$g]); } } } } } print_r($chunks); print_r($ids);

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.68
8.3.50.0090.01316.50
8.3.40.0040.01218.60
8.3.30.0060.00918.71
8.3.20.0050.00320.77
8.3.10.0070.00021.90
8.3.00.0040.00419.25
8.2.180.0070.00716.88
8.2.170.0090.00622.96
8.2.160.0090.00619.13
8.2.150.0030.00524.18
8.2.140.0060.00324.66
8.2.130.0080.00018.03
8.2.120.0080.00026.35
8.2.110.0150.00422.16
8.2.100.0040.00818.03
8.2.90.0000.00817.75
8.2.80.0000.01117.97
8.2.70.0000.00818.03
8.2.60.0080.00018.15
8.2.50.0040.00418.10
8.2.40.0050.00320.62
8.2.30.0000.00719.39
8.2.20.0000.00818.14
8.2.10.0040.00418.14
8.2.00.0050.00317.76
8.1.280.0070.00725.92
8.1.270.0040.00422.24
8.1.260.0080.00026.35
8.1.250.0050.00328.09
8.1.240.0090.00022.65
8.1.230.0110.00717.75
8.1.220.0050.00317.77
8.1.210.0000.00918.77
8.1.200.0070.00317.35
8.1.190.0040.00419.30
8.1.180.0080.00018.10
8.1.170.0040.00418.65
8.1.160.0000.00718.95
8.1.150.0000.00820.39
8.1.140.0040.00419.51
8.1.130.0000.00718.98
8.1.120.0040.00417.38
8.1.110.0030.00617.38
8.1.100.0000.00917.53
8.1.90.0050.00217.39
8.1.80.0000.00817.47
8.1.70.0030.00317.50
8.1.60.0050.00517.66
8.1.50.0000.00817.59
8.1.40.0000.00817.54
8.1.30.0060.00317.71
8.1.20.0000.00817.58
8.1.10.0040.00417.49
8.1.00.0000.00817.43
8.0.300.0040.00421.36
8.0.290.0040.00416.63
8.0.280.0030.00318.39
8.0.270.0040.00417.27
8.0.260.0000.00817.33
8.0.250.0000.00817.04
8.0.240.0030.00317.01
8.0.230.0050.00517.05
8.0.220.0030.00317.06
8.0.210.0050.00216.87
8.0.200.0000.01016.91
8.0.190.0050.00317.05
8.0.180.0000.00716.97
8.0.170.0040.00416.91
8.0.160.0040.00417.08
8.0.150.0040.00416.96
8.0.140.0000.00716.96
8.0.130.0060.00013.37
8.0.120.0000.00816.94
8.0.110.0040.00416.86
8.0.100.0000.00716.93
8.0.90.0030.00516.88
8.0.80.0110.00717.05
8.0.70.0030.00516.94
8.0.60.0000.00716.79
8.0.50.0040.00416.85
8.0.30.0120.00817.18
8.0.20.0140.00717.40
8.0.10.0040.00416.99
8.0.00.0120.00716.79
7.4.330.0030.00315.55
7.4.320.0030.00316.50
7.4.300.0000.00616.57
7.4.290.0070.00016.51
7.4.280.0000.00816.61
7.4.270.0000.00716.66
7.4.260.0050.00216.61
7.4.250.0040.00416.49
7.4.240.0050.00216.49
7.4.230.0070.00016.38
7.4.220.0030.01516.40
7.4.210.0110.01116.60
7.4.200.0000.00716.33
7.4.160.0100.00716.69
7.4.150.0060.01317.40
7.4.140.0060.01617.86
7.4.130.0130.00616.51
7.4.120.0090.01016.65
7.4.110.0080.01416.47
7.4.100.0110.00716.48
7.4.90.0090.01216.36
7.4.80.0040.01516.41
7.4.70.0060.01216.64
7.4.60.0130.00516.53
7.4.50.0070.01016.45
7.4.40.0150.00916.61
7.4.30.0060.01516.35
7.4.00.0030.01514.81
7.3.330.0000.00513.16
7.3.320.0030.00313.21
7.3.310.0000.00716.29
7.3.300.0000.00716.35
7.3.290.0080.00616.32
7.3.280.0090.00816.38
7.3.270.0080.00817.40
7.3.260.0110.00916.59
7.3.250.0090.01116.54
7.3.240.0140.00316.52
7.3.230.0140.00316.36
7.3.210.0110.00516.43
7.3.200.0070.01316.35
7.3.190.0000.01616.36
7.3.180.0100.00616.48
7.3.170.0110.00716.38
7.3.160.0060.01216.57
7.3.120.0100.00914.70
7.3.110.0030.01414.97
7.3.100.0130.00314.90
7.3.90.0070.00715.03
7.3.80.0070.01014.88
7.3.70.0000.01314.93
7.3.60.0040.00414.86
7.3.50.0000.01515.05
7.3.40.0030.01214.94
7.3.30.0100.00314.81
7.3.20.0100.00316.75
7.3.10.0070.01016.71
7.3.00.0060.00916.73
7.2.330.0110.00716.59
7.2.320.0070.01416.64
7.2.310.0060.00916.45
7.2.300.0070.01616.70
7.2.290.0090.00616.43
7.2.250.0110.01115.31
7.2.240.0130.00614.90
7.2.230.0060.00915.38
7.2.220.0060.00615.30
7.2.210.0040.00815.02
7.2.200.0040.01115.07
7.2.190.0060.00915.22
7.2.180.0000.01415.27
7.2.170.0120.00314.97
7.2.160.0040.01015.12
7.2.150.0150.00316.99
7.2.140.0090.00617.02
7.2.130.0100.00316.84
7.2.120.0130.00316.77
7.2.110.0000.01016.70
7.2.100.0040.00816.93
7.2.90.0040.00816.97
7.2.80.0000.01416.87
7.2.70.0000.01417.00
7.2.60.0060.00616.74
7.2.50.0060.01016.60
7.2.40.0040.01116.79
7.2.30.0070.00716.65
7.2.20.0050.00516.95
7.2.10.0040.00717.04
7.2.00.0000.01416.87
7.1.330.0060.01016.02
7.1.320.0100.00315.91
7.1.310.0070.00715.86
7.1.300.0070.00315.63
7.1.290.0060.00615.84
7.1.280.0070.00415.84
7.1.270.0030.00915.75
7.1.260.0000.00915.90
7.1.250.0090.00315.65
7.1.240.0060.00315.60
7.1.230.0090.00615.80
7.1.220.0040.01115.69
7.1.210.0110.00315.82
7.1.200.0040.00615.87
7.1.190.0000.00815.61
7.1.180.0090.00315.63
7.1.170.0040.01115.57
7.1.160.0100.00015.75
7.1.150.0120.00315.87
7.1.140.0000.01415.88
7.1.130.0030.00615.66
7.1.120.0040.01115.91
7.1.110.0040.00415.93
7.1.100.0000.01015.96
7.1.90.0000.00815.98
7.1.80.0060.00315.70
7.1.70.0050.00916.32
7.1.60.0040.00616.47
7.1.50.0040.00715.79
7.1.40.0000.01015.84
7.1.30.0140.00015.55
7.1.20.0060.01215.70
7.1.10.0060.00315.59
7.1.00.0250.02718.14
7.0.330.0030.01015.37
7.0.320.0070.01015.43
7.0.310.0040.00415.57
7.0.300.0000.01115.03
7.0.290.0030.00615.37
7.0.280.0030.01315.52
7.0.270.0000.00915.24
7.0.260.0070.00415.46
7.0.250.0030.00715.39
7.0.240.0040.00815.42
7.0.230.0040.01115.63
7.0.220.0000.01315.38
7.0.210.0060.00315.52
7.0.200.0040.01016.07
7.0.190.0030.00615.56
7.0.180.0070.01115.51
7.0.170.0000.01715.45
7.0.160.0090.00615.55
7.0.150.0040.00815.53
7.0.140.0370.04117.92
7.0.130.0220.03217.96
7.0.120.0180.03817.91
7.0.110.0190.03417.94
7.0.100.0260.03917.80
7.0.90.1850.04017.88
7.0.80.0190.03217.82
7.0.70.0450.03717.67
7.0.60.0130.03917.93
7.0.50.0170.03317.89
7.0.40.0240.02816.92
7.0.30.0200.03016.98
7.0.20.0200.03316.94
7.0.10.0180.03416.78
7.0.00.0210.03416.97
5.6.400.0070.00713.91
5.6.390.0130.00314.05
5.6.380.0070.01014.05
5.6.370.0100.00014.52
5.6.360.0070.00714.65
5.6.350.0060.00614.62
5.6.340.0030.00614.21
5.6.330.0070.00714.41
5.6.320.0030.01414.54
5.6.310.0070.00713.96
5.6.300.0080.00614.23
5.6.290.0080.03117.52
5.6.280.0050.03717.77
5.6.270.0060.03817.72
5.6.260.0050.03717.69
5.6.250.0130.04217.73
5.6.240.0100.03417.80
5.6.230.0150.03017.88
5.6.220.0070.03217.65
5.6.210.0060.03617.52
5.6.200.0080.03117.72
5.6.190.0110.03017.71
5.6.180.0080.03417.68
5.6.170.0160.03117.49
5.6.160.0080.03317.60
5.6.150.0110.04117.74
5.6.140.0050.04817.57
5.6.130.0190.02017.51
5.6.120.0130.02717.80
5.6.110.0100.03517.73
5.6.100.0030.03817.63
5.6.90.0120.03117.79
5.6.80.0120.02717.29
5.6.70.0110.03417.24
5.6.60.0090.03917.37
5.6.50.0080.03217.34
5.6.40.0080.03017.21
5.6.30.0120.03017.39
5.6.20.0080.02817.29
5.6.10.0100.02817.35
5.6.00.0130.02517.46

preferences:
66.2 ms | 401 KiB | 5 Q