3v4l.org

run code in 300+ PHP versions simultaneously
<?php $albums = ['1','2','3','4','5','6','7','8','9','10','11','12']; $incr = 1; $section_id = 1; $sections = []; foreach ($albums as $album) { $small = ($incr % 2 == 0 && $section_id % 2 != 0) || $incr % 3 == 0; if ($section_id % 2 == 0) { $small = !$small; } $sections[$section_id][($small ? 'small' : 'big')][] = [ 'id' => $album, ]; if ($incr % 3 == 0) { $section_id++; } $incr++; } print_r($sections);

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.0120.00616.63
8.3.50.0040.01216.49
8.3.40.0160.00318.97
8.3.30.0070.00718.83
8.3.20.0050.00221.94
8.3.10.0080.00023.70
8.3.00.0080.00018.05
8.2.180.0170.00318.42
8.2.170.0170.00322.96
8.2.160.0070.00721.09
8.2.150.0070.00024.18
8.2.140.0050.00324.66
8.2.130.0070.00022.25
8.2.120.0000.00726.35
8.2.110.0070.00319.45
8.2.100.0090.00317.84
8.2.90.0050.00319.34
8.2.80.0000.00817.97
8.2.70.0050.00317.50
8.2.60.0080.00017.93
8.2.50.0000.00818.10
8.2.40.0000.00820.59
8.2.30.0060.00319.23
8.2.20.0040.00418.01
8.2.10.0050.00318.13
8.2.00.0040.00418.00
8.1.280.0100.00325.92
8.1.270.0030.00523.94
8.1.260.0050.00226.35
8.1.250.0020.00528.09
8.1.240.0030.00621.50
8.1.230.0040.00719.06
8.1.220.0030.00717.74
8.1.210.0030.00518.77
8.1.200.0040.00417.23
8.1.190.0050.00517.11
8.1.180.0040.00418.10
8.1.170.0050.00318.66
8.1.160.0050.00218.82
8.1.150.0050.00220.15
8.1.140.0040.00419.70
8.1.130.0080.00318.91
8.1.120.0000.00717.42
8.1.110.0040.00417.30
8.1.100.0040.00417.39
8.1.90.0040.00417.46
8.1.80.0030.00317.37
8.1.70.0000.00817.38
8.1.60.0060.00317.48
8.1.50.0080.00017.55
8.1.40.0030.00517.49
8.1.30.0040.00417.71
8.1.20.0040.00417.68
8.1.10.0000.00717.62
8.1.00.0000.00717.40
8.0.300.0000.00719.93
8.0.290.0000.00716.63
8.0.280.0000.00718.46
8.0.270.0030.00317.19
8.0.260.0030.00316.75
8.0.250.0020.00516.90
8.0.240.0040.00416.98
8.0.230.0000.00716.96
8.0.220.0000.00716.92
8.0.210.0030.00316.97
8.0.200.0000.00616.98
8.0.190.0060.00316.81
8.0.180.0000.00716.93
8.0.170.0050.00216.76
8.0.160.0000.00716.95
8.0.150.0000.00716.84
8.0.140.0030.00316.80
8.0.130.0030.00313.38
8.0.120.0030.00516.80
8.0.110.0070.00016.86
8.0.100.0050.00216.80
8.0.90.0000.00716.91
8.0.80.0120.00316.79
8.0.70.0080.00016.91
8.0.60.0000.00716.91
8.0.50.0050.00216.86
8.0.30.0100.00617.08
8.0.20.0100.00917.40
8.0.10.0040.00416.86
8.0.00.0100.00716.80
7.4.330.0020.00215.55
7.4.320.0030.00316.63
7.4.300.0000.00716.61
7.4.290.0030.00316.46
7.4.280.0040.00416.65
7.4.270.0070.00016.51
7.4.260.0030.00313.34
7.4.250.0050.00316.63
7.4.240.0030.00316.53
7.4.230.0000.00716.32
7.4.220.0090.00616.63
7.4.210.0120.00616.56
7.4.200.0070.00016.62
7.4.160.0100.00516.38
7.4.150.0110.00717.40
7.4.140.0060.01317.86
7.4.130.0130.00716.42
7.4.120.0100.00716.64
7.4.110.0070.01016.49
7.4.100.0110.00616.46
7.4.90.0070.01016.49
7.4.80.0100.00919.39
7.4.70.0150.00916.72
7.4.60.0100.00716.56
7.4.50.0000.01516.27
7.4.40.0060.01016.21
7.4.30.0100.00716.59
7.4.00.0040.01114.90
7.3.330.0060.00013.23
7.3.320.0000.00513.23
7.3.310.0000.00716.21
7.3.300.0040.00416.38
7.3.290.0080.00816.35
7.3.280.0100.00816.36
7.3.270.0070.01117.40
7.3.260.0130.00516.48
7.3.250.0130.00516.49
7.3.240.0110.01016.60
7.3.230.0100.00616.55
7.3.210.0060.01616.41
7.3.200.0100.00616.31
7.3.190.0080.00816.58
7.3.180.0070.00916.39
7.3.170.0100.00716.46
7.3.160.0070.01416.34
7.3.10.0090.00516.43
7.3.00.0100.00516.56
7.2.330.0100.00716.61
7.2.320.0130.00916.54
7.2.310.0030.01416.80
7.2.300.0060.01016.78
7.2.290.0110.01116.75
7.2.130.0080.01016.58
7.2.120.0110.00516.69
7.2.110.0110.00716.53
7.2.100.0100.00416.42
7.2.90.0110.00516.74
7.2.80.0070.01116.60
7.2.70.0110.00516.67
7.2.60.0140.00417.02
7.2.50.0150.00416.66
7.2.40.0030.00816.80
7.2.30.0050.01116.52
7.2.20.0130.00816.76
7.2.10.0140.00716.55
7.2.00.0040.00917.77
7.1.250.0080.00615.53
7.1.100.0000.01117.97
7.1.70.0040.00417.25
7.1.60.0830.01333.34
7.1.50.1330.01033.05
7.1.40.1700.00732.62
7.1.30.1000.01032.63
7.1.20.0270.01032.73
7.1.10.0670.01314.63
7.1.00.0470.01014.79
7.0.200.0230.01015.09
7.0.190.0700.01714.73
7.0.180.1070.00314.65
7.0.170.0930.00714.37
7.0.160.0670.01714.33
7.0.150.0600.01014.16
7.0.140.0470.01314.67
7.0.130.0570.01014.49
7.0.120.0570.01014.86
7.0.110.0500.01314.41
7.0.100.0530.01014.61
7.0.90.0600.01314.57
7.0.80.0400.01714.71
7.0.70.0470.00714.39
7.0.60.0500.01014.14
7.0.50.0470.01014.46
7.0.40.0430.00714.59
7.0.30.0400.01314.68
7.0.20.0430.01714.63
7.0.10.0730.01314.32
7.0.00.0770.01714.64

preferences:
46.47 ms | 400 KiB | 5 Q