3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = [ ['id' => 1, 'nickname' => 'abc', 'game' => 'abc', 'checkbox' => 1], ['id' => 2, 'nickname' => 'xyz', 'game' => 'zyx', 'checkbox' => 0], ['id' => 5, 'nickname' => 'xyz', 'game' => 'abc', 'checkbox' => 1], ['id' => 6, 'nickname' => 'afg', 'game' => 'zyx', 'checkbox' => 1], ]; // The data must be sorted by the game, that's the key $sortedData = [ ['id' => 1, 'nickname' => 'abc', 'game' => 'abc', 'checkbox' => 1], ['id' => 5, 'nickname' => 'xyz', 'game' => 'abc', 'checkbox' => 1], ['id' => 2, 'nickname' => 'xyz', 'game' => 'zyx', 'checkbox' => 0], ['id' => 6, 'nickname' => 'afg', 'game' => 'zyx', 'checkbox' => 1], ]; // Figure out which game should span how many rows ahead of time foreach ($sortedData as $row) { $gameCounts[$row['game']] ??= 0; $gameCounts[$row['game']]++; } echo '<table border="1">'; echo '<thead>'; echo '<tr>'; foreach (array_keys($sortedData[0]) as $header) { echo '<th>'.$header.'</th>'; } echo '</tr>'; echo '</thead>'; echo '<tbody>'; $previousGame = null; foreach ($sortedData as $row) { echo '<tr>'; foreach ($row as $key => $value) { if ($key === 'game') { // Game changed - span the cell over the correct number of rows if ($previousGame !== $value) { echo '<td rowspan="'.$gameCounts[$value].'">'.$value.'</td>'; $previousGame = $value; } continue; } echo '<td>'.$value.'</td>'; } echo '</tr>'; } echo '</tbody>'; echo '</table>';

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.00.0100.01220.20
8.4.150.0010.00114.05
8.4.140.0150.00817.39
8.4.130.0100.01117.92
8.4.120.0090.01022.03
8.4.110.0120.01122.59
8.4.100.0130.00720.40
8.4.90.0130.00817.91
8.4.80.0100.01017.72
8.4.70.0030.00617.89
8.4.60.0090.01220.20
8.4.50.0140.00518.71
8.4.40.0100.01017.62
8.4.30.0130.00618.83
8.4.20.0110.01119.43
8.4.10.0000.00919.39
8.3.280.0120.00918.52
8.3.270.0110.00816.54
8.3.260.0090.01016.73
8.3.250.0080.00518.88
8.3.240.0110.01016.66
8.3.230.0070.00716.66
8.3.220.0110.00417.25
8.3.210.0130.00716.43
8.3.200.0060.00316.52
8.3.190.0110.00717.11
8.3.180.0120.00718.52
8.3.170.0100.01016.83
8.3.160.0070.01116.48
8.3.150.0130.00617.25
8.3.140.0090.00917.16
8.3.130.0030.00518.59
8.3.120.0030.00716.64
8.3.110.0040.00416.59
8.3.100.0030.00616.77
8.3.90.0230.01026.77
8.3.80.0030.00526.77
8.3.50.0100.00326.77
8.2.290.0080.01120.80
8.2.280.0060.00420.11
8.2.270.0060.01317.25
8.2.260.0000.00818.58
8.2.250.0000.00816.68
8.2.240.0050.00517.12
8.2.230.0060.00320.94
8.2.220.0060.00324.06
8.2.210.0030.01026.77
8.2.200.0040.00426.77
8.1.330.0120.00721.66
8.1.320.0090.01016.39
8.1.310.0000.00816.95
8.1.300.0090.00018.09
8.1.290.0040.01126.77

preferences:
28.98 ms | 403 KiB | 5 Q