3v4l.org

run code in 500+ PHP versions simultaneously
<?php $arr = [ [ 'foo 1', 'bar 1', '', '', 'test 1', 'lorem 1', 'ipsum 1', '', 'will be ignored 1', ], [ 'foo 2', 'bar 2', '', '', 'test 2', 'lorem 2', 'ipsum 2', '', 'will be ignored 2', ], [ 'foo 3', 'bar 3', '', '', 'test 3', 'lorem 3', 'ipsum 3', '', 'will be ignored 3', ], [ 'foo 4', 'bar 4', '', '', 'test 4', 'lorem 4', 'ipsum 4', '', 'will be ignored 4', ], ]; $newArray = []; foreach($arr as $sub) { // The example array you say you want have 8 elements, indexes 0-7 $newArray[] = array_slice($sub, 0, 8); } print_r($newArray);

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.5.70.0040.00516.76
8.5.60.0070.00916.70
8.5.50.0060.01116.75
8.5.30.0090.00919.05
8.5.20.0110.00719.49
8.5.10.0070.01020.38
8.5.00.0110.01019.78
8.4.220.0140.00819.41
8.4.210.0120.00519.45
8.4.180.0140.00823.97
8.4.170.0120.00923.92
8.4.160.0140.00723.91
8.4.150.0060.00216.87
8.4.140.0070.00417.71
8.4.130.0130.00717.64
8.4.120.0110.00920.32
8.4.110.0120.00922.71
8.4.100.0150.00617.82
8.4.90.0060.00318.34
8.4.80.0100.01117.82
8.4.70.0110.00918.01
8.4.60.0060.00418.87
8.4.50.0110.00817.75
8.4.40.0090.00017.63
8.4.30.0060.01020.62
8.4.20.0090.00319.50
8.4.10.0160.00317.91
8.3.310.0070.00718.45
8.3.300.0130.00722.68
8.3.290.0130.01118.55
8.3.280.0130.00620.15
8.3.270.0100.00816.52
8.3.260.0130.00716.76
8.3.250.0100.01018.85
8.3.240.0140.00316.55
8.3.230.0120.00816.56
8.3.220.0110.00617.41
8.3.210.0090.00616.86
8.3.200.0030.00516.63
8.3.190.0090.00917.41
8.3.180.0120.00716.65
8.3.170.0040.00418.94
8.3.160.0130.00618.23
8.3.150.0190.00017.13
8.3.140.0040.01216.51
8.3.130.0070.00018.58
8.3.120.0040.00418.95
8.3.110.0150.00020.94
8.3.100.0070.00424.06
8.3.90.0000.01026.77
8.3.80.0050.00516.63
8.3.70.0140.00716.75
8.3.60.0040.01116.63
8.3.50.0090.00918.05
8.3.40.0150.00320.09
8.3.30.0140.00018.77
8.3.20.0050.00224.18
8.3.10.0080.00024.66
8.3.00.0080.00026.16
8.2.310.0090.01219.89
8.2.300.0120.00818.17
8.2.290.0150.00420.32
8.2.280.0100.00718.19
8.2.270.0130.00616.89
8.2.260.0140.00418.61
8.2.250.0090.00016.48
8.2.240.0160.00316.81
8.2.230.0060.00322.58
8.2.220.0040.00437.54
8.2.210.0040.00426.77
8.2.200.0060.00316.50
8.2.190.0070.01116.58
8.2.180.0120.00325.92
8.2.170.0040.01119.08
8.2.160.0070.01022.96
8.2.150.0040.00425.66
8.2.140.0000.00824.66
8.2.130.0070.00026.16
8.2.120.0000.00819.63
8.2.110.0030.00620.27
8.2.100.0080.00818.03
8.2.90.0000.00817.63
8.2.80.0040.00418.77
8.2.70.0080.00017.63
8.2.60.0000.00918.05
8.2.50.0060.00618.07
8.2.40.0050.00319.94
8.2.30.0030.00518.13
8.2.20.0040.00420.43
8.2.10.0040.00417.61
8.2.00.0040.00419.30
8.1.340.0110.01019.43
8.1.330.0120.00723.61
8.1.320.0160.00317.79
8.1.310.0070.00716.75
8.1.300.0090.00017.88
8.1.290.0040.00818.88
8.1.280.0100.00725.92
8.1.270.0000.00823.99
8.1.260.0030.01326.35
8.1.250.0040.00428.09
8.1.240.0100.00619.01
8.1.230.0000.01117.83
8.1.220.0080.00017.74
8.1.210.0040.00418.77
8.1.200.0030.00717.35
8.1.190.0060.00317.23
8.1.180.0080.00018.10
8.1.170.0000.00718.59
8.1.160.0040.00418.94
8.1.150.0040.00418.56
8.1.140.0040.00417.37
8.1.130.0050.00318.90
8.1.120.0000.00717.50
8.1.110.0040.00417.41
8.1.100.0040.00417.53
8.1.90.0080.00017.42
8.1.80.0030.00717.50
8.1.70.0070.00017.42
8.1.60.0050.00317.50
8.1.50.0000.00917.57
8.1.40.0040.00417.43
8.1.30.0030.00517.56
8.1.20.0040.00417.61
8.1.10.0060.00317.31
8.1.00.0030.00517.21
8.0.300.0060.00318.77
8.0.290.0030.00616.63
8.0.280.0050.00320.28
8.0.270.0040.00419.80
8.0.260.0070.00018.42
8.0.250.0030.00316.93
8.0.240.0070.00016.82
8.0.230.0040.00417.05
8.0.220.0070.00016.78
8.0.210.0040.00416.92
8.0.200.0030.00316.96
8.0.190.0060.00316.83
8.0.180.0040.00416.92
8.0.170.0050.00316.94
8.0.160.0000.00716.91
8.0.150.0000.00716.80
8.0.140.0040.00416.74
8.0.130.0040.00416.88
8.0.120.0050.00216.75
8.0.110.0050.00216.91
8.0.100.0080.00016.72
8.0.90.0040.00416.82
8.0.80.0070.00016.88
8.0.70.0000.00816.89
8.0.60.0000.00716.89
8.0.50.0030.00316.92
8.0.30.0040.00416.82
8.0.20.0050.00216.96
8.0.10.0040.00417.02
7.4.330.0050.00015.55
7.4.320.0030.00316.60
7.4.300.0030.00316.50
7.4.290.0070.00016.52
7.4.280.0000.00816.55
7.4.270.0030.00316.43
7.4.260.0040.00416.48
7.4.250.0030.00316.52
7.4.240.0070.00016.55
7.4.230.0000.00716.46
7.4.220.0080.00016.59
7.4.210.0000.00816.39
7.4.200.0020.00516.58
7.4.190.0030.00316.63
7.4.180.0030.00316.70
7.4.160.0080.00016.41
7.4.150.0050.00316.54
7.4.140.0030.00316.43
7.4.130.0000.00816.28
7.4.120.0030.00316.35
7.4.110.0030.00316.43
7.4.100.0000.00716.41
7.4.90.0030.00316.28
7.4.80.0040.00416.41
7.4.70.0080.00016.27
7.4.60.0000.00716.48
7.4.50.0030.00416.43
7.4.40.0040.00416.25
7.4.30.0070.00016.42
7.4.20.0000.00716.41
7.4.10.0070.00016.45
7.4.00.0000.00716.51

preferences:
48.05 ms | 1444 KiB | 5 Q