3v4l.org

run code in 300+ PHP versions simultaneously
<?php $items = [ ['type' => 1, 'text' => 'A'], ['type' => 2, 'text' => 'B'], ['type' => 2, 'text' => 'C'], ['type' => 3, 'text' => 'D'], ['type' => 2, 'text' => 'E'], ['type' => 1, 'text' => 'F'], ['type' => 4, 'text' => 'G'], ['type' => 2, 'text' => 'H'], ['type' => 1, 'text' => 'I'], ['type' => 4, 'text' => 'J'], ['type' => 2, 'text' => 'K'], ['type' => 4, 'text' => 'L'], ['type' => 2, 'text' => 'M'], ['type' => 3, 'text' => 'N'], ['type' => 3, 'text' => 'O'], ['type' => 1, 'text' => 'P'], ['type' => 1, 'text' => 'Q'], ['type' => 2, 'text' => 'R'], ['type' => 3, 'text' => 'S'], ['type' => 2, 'text' => 'T'], ['type' => 3, 'text' => 'U'], ['type' => 2, 'text' => 'V'], ['type' => 3, 'text' => 'W'], ['type' => 2, 'text' => 'X'], ['type' => 4, 'text' => 'Y'], ['type' => 2, 'text' => 'Z'], ]; $maxConsecutive = 3; $grouper = []; $column = []; foreach ($items as $row) { $column[] = $row['type']; $encountered[$row['type']] ??= 0; $grouper[] = intdiv($encountered[$row['type']], $maxConsecutive); ++$encountered[$row['type']]; } array_multisort($grouper, $column, $items); var_export($items);

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.4.120.0120.00420.21
8.4.110.0060.00622.45
8.4.100.0140.00717.52
8.4.90.0120.00920.50
8.4.80.0080.00419.50
8.4.70.0080.01217.81
8.4.60.0120.00824.07
8.4.50.0100.01118.93
8.4.40.0100.01017.56
8.4.30.0070.01318.69
8.4.20.0030.00520.89
8.4.10.0060.00319.56
8.3.250.0030.00618.88
8.3.240.0120.00616.55
8.3.230.0110.00916.51
8.3.220.0130.00417.22
8.3.210.0130.01018.36
8.3.200.0030.00616.79
8.3.190.0080.00717.32
8.3.180.0100.00918.30
8.3.170.0040.01819.21
8.3.160.0070.00316.39
8.3.150.0120.00618.55
8.3.140.0050.00317.25
8.3.130.0030.00618.34
8.3.120.0000.00818.81
8.3.110.0070.00320.94
8.3.100.0000.00818.21
8.3.90.0040.01126.77
8.3.80.0030.00617.97
8.3.70.0150.00616.61
8.3.60.0120.00618.43
8.3.50.0170.00016.60
8.3.40.0120.00920.22
8.3.30.0070.00721.92
8.3.20.0040.00424.18
8.3.10.0080.00024.66
8.3.00.0040.00426.16
8.2.290.0050.01120.48
8.2.280.0070.00218.44
8.2.270.0100.01017.45
8.2.260.0120.00618.35
8.2.250.0070.01118.67
8.2.240.0120.00316.51
8.2.230.0060.00922.58
8.2.220.0060.00324.06
8.2.210.0090.00026.77
8.2.200.0060.00316.88
8.2.190.0100.00716.58
8.2.180.0110.01116.75
8.2.170.0180.00319.09
8.2.160.0100.00722.96
8.2.150.0050.00325.66
8.2.140.0040.00424.66
8.2.130.0050.00226.16
8.2.120.0040.00420.75
8.2.110.0090.01222.02
8.2.100.0130.00920.99
8.2.90.0200.00720.70
8.2.80.0080.01120.61
8.2.70.0210.00620.61
8.2.60.0220.00418.72
8.2.50.0140.00321.68
8.2.40.0070.01020.69
8.2.30.0150.00320.43
8.2.20.0090.00619.21
8.2.10.0190.00318.89
8.2.00.0110.00719.01
8.1.330.0120.00821.88
8.1.320.0080.01216.21
8.1.310.0110.00718.41
8.1.300.0080.00020.02
8.1.290.0060.00330.84
8.1.280.0120.00925.92
8.1.270.0080.00024.66
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0070.01018.59
8.1.230.0060.00318.56
8.1.220.0110.00018.62
8.1.210.0140.00719.46
8.1.200.0110.00318.48
8.1.190.0050.00519.53
8.1.180.0130.00018.50
8.1.170.0130.00018.48
8.1.160.0190.00618.86
8.1.150.0090.00320.59
8.1.140.0100.01718.45
8.1.130.0120.00618.61
8.1.120.0130.00318.50
8.1.110.0030.00619.74
8.1.100.0050.00518.46
8.1.90.0060.00318.36
8.1.80.0050.00519.93
8.1.70.0000.00920.52
8.1.60.0140.00018.73
8.1.50.0030.00718.43
8.1.40.0120.00018.94
8.1.30.0030.00718.89
8.1.20.0100.00020.50
8.1.10.0060.00618.74
8.1.00.0100.01320.48
8.0.300.0060.00319.67
8.0.290.0080.00417.86
8.0.280.0070.00317.78
8.0.270.0090.00019.54
8.0.260.0100.01020.32
8.0.250.0270.00319.68
8.0.240.0070.00419.70
8.0.230.0030.00619.96
8.0.220.0060.00617.90
8.0.210.0250.00317.95
8.0.200.0140.00717.75
8.0.190.0040.00819.85
8.0.180.0090.00019.82
8.0.170.0090.00019.75
8.0.160.0090.00618.02
8.0.150.0040.00417.71
8.0.140.0090.00317.75
8.0.130.0050.00518.13
8.0.120.0100.00317.65
8.0.110.0090.00020.17
8.0.100.0070.00319.64
8.0.90.0000.01017.79
8.0.80.0030.00717.77
8.0.70.0090.00019.53
8.0.60.0090.00020.05
8.0.50.0110.00017.73
8.0.30.0030.00620.00
8.0.20.0040.00419.76
8.0.10.0060.00319.52

preferences:
28.88 ms | 403 KiB | 5 Q