3v4l.org

run code in 300+ PHP versions simultaneously
<?php $resultObject = [ ['name' => 'Tom', 'value' => 15, 'year' => 2018], ['name' => 'Tom', 'value' => 4, 'year' => 2019], ['name' => 'Tom', 'value' => 6, 'year' => 2020], ['name' => 'Kate', 'value' => 18, 'year' => 2018], ['name' => 'Kate', 'value' => 20, 'year' => 2019], ]; $grouped = []; $columns = []; foreach ($resultObject as $row) { $grouped[$row['name']][$row['year']] = $row['value']; $columns[$row['year']] = $row['year']; } sort($columns); $defaults = array_fill_keys($columns, '-'); array_unshift($columns, 'name'); echo "<table>\n"; printf( "<tr><th>%s</th></tr>\n", implode('</th><th>', $columns) ); foreach ($grouped as $name => $records) { printf( "<tr><td>%s</td><td>%s</td></tr>\n", $name, implode('</td><td>', array_replace($defaults, $records)) ); } 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.4.130.0100.01117.73
8.4.120.0120.00620.22
8.4.110.0110.00918.72
8.4.100.0140.00717.48
8.4.90.0110.00918.59
8.4.80.0030.00619.43
8.4.70.0100.01017.59
8.4.60.0110.00918.82
8.4.50.0120.01017.79
8.4.40.0080.00020.77
8.4.30.0060.00920.45
8.4.20.0100.01024.29
8.4.10.0100.01021.03
8.3.260.0140.00616.39
8.3.250.0140.00518.84
8.3.240.0090.01016.62
8.3.230.0110.01016.59
8.3.220.0090.00917.41
8.3.210.0100.00916.58
8.3.200.0070.00216.62
8.3.190.0110.00717.23
8.3.180.0100.00916.34
8.3.170.0110.00718.80
8.3.160.0060.00316.64
8.3.150.0150.00317.26
8.3.140.0040.00416.62
8.3.130.0070.01018.63
8.3.120.0030.00619.04
8.3.110.0030.00520.94
8.3.100.0090.00024.06
8.3.90.0040.00426.77
8.3.80.0030.00616.38
8.3.70.0110.01116.88
8.3.60.0060.01216.63
8.3.50.0130.00424.38
8.3.40.0160.00320.29
8.3.30.0120.00318.45
8.3.20.0040.00424.18
8.3.10.0080.00024.66
8.3.00.0040.00426.16
8.2.290.0110.00620.52
8.2.280.0110.00818.65
8.2.270.0200.00016.82
8.2.260.0060.01318.61
8.2.250.0060.00316.70
8.2.240.0000.00918.96
8.2.230.0070.00322.58
8.2.220.0060.00337.54
8.2.210.0080.00026.77
8.2.200.0040.00816.50
8.2.190.0120.00616.63
8.2.180.0070.00725.92
8.2.170.0130.00318.83
8.2.160.0100.00322.96
8.2.150.0000.00825.66
8.2.140.0060.00324.66
8.2.130.0040.00426.16
8.2.120.0040.00419.89
8.2.110.0070.00420.73
8.2.100.0090.00219.28
8.2.90.0050.00419.16
8.2.80.0020.00719.26
8.2.70.0030.00619.12
8.2.60.0100.00817.91
8.2.50.0100.00517.93
8.2.40.0090.00518.08
8.2.30.0100.00518.06
8.2.20.0100.00417.94
8.2.10.0100.00518.12
8.2.00.0110.00418.12
8.1.330.0090.00921.90
8.1.320.0140.00615.96
8.1.310.0060.01216.50
8.1.300.0040.00418.17
8.1.290.0030.00630.84
8.1.280.0070.00725.92
8.1.270.0040.00423.99
8.1.260.0030.00626.35
8.1.250.0000.00828.09
8.1.240.0060.00320.60
8.1.230.0090.00219.74
8.1.220.0010.00919.03
8.1.210.0030.00620.28
8.1.200.0080.00218.79
8.1.190.0120.00417.71
8.1.180.0140.00317.73
8.1.170.0100.00517.82
8.1.160.0100.00517.91
8.1.150.0090.00617.91
8.1.140.0120.00317.86
8.1.130.0090.00718.04
8.1.120.0110.00417.71
8.1.110.0130.00317.73
8.1.100.0110.00517.66
8.1.90.0090.00617.63
8.1.80.0110.00417.63
8.1.70.0090.00617.66
8.1.60.0130.00417.77
8.1.50.0130.00417.70
8.1.40.0110.00617.76
8.1.30.0110.00617.83
8.1.20.0120.00517.81
8.1.10.0120.00517.74
8.1.00.0120.00417.69
8.0.300.0050.00419.68
8.0.290.0070.00218.28
8.0.280.0100.00517.44
8.0.270.0110.00417.24
8.0.260.0090.00617.41
8.0.250.0110.00417.28
8.0.240.0100.00517.32
8.0.230.0090.00517.22
8.0.220.0110.00417.22
8.0.210.0100.00517.11
8.0.200.0100.00417.22
8.0.190.0110.00417.22
8.0.180.0120.00317.20
8.0.170.0100.00517.12
8.0.160.0100.00517.16
8.0.150.0100.00517.15
8.0.140.0100.00517.14
8.0.130.0110.00416.84
8.0.120.0110.00417.14
8.0.110.0100.00517.16
8.0.100.0100.00517.13
8.0.90.0090.00517.15
8.0.80.0100.00617.13
8.0.70.0110.00417.12
8.0.60.0090.00517.18
8.0.50.0100.00417.13
8.0.30.0090.00617.10
8.0.20.0090.00617.14
8.0.10.0100.00417.22
8.0.00.0090.00717.19
7.4.330.0120.00416.87
7.4.320.0120.00417.09
7.4.300.0110.00416.95
7.4.290.0110.00516.81
7.4.280.0120.00416.76
7.4.270.0110.00516.93
7.4.260.0110.00516.68
7.4.250.0130.00516.94
7.4.240.0120.00416.84
7.4.230.0100.00616.81
7.4.220.0100.00516.76
7.4.210.0080.00716.88
7.4.200.0100.00416.83
7.4.190.0110.00416.91
7.4.180.0120.00516.87
7.4.160.0110.00516.82
7.4.150.0100.00616.79
7.4.140.0100.00616.87
7.4.130.0110.00516.72
7.4.120.0110.00516.71
7.4.110.0100.00616.74
7.4.100.0110.00416.89
7.4.90.0100.00416.87
7.4.80.0100.00516.73
7.4.70.0100.00516.75
7.4.60.0090.00616.71
7.4.50.0100.00616.77
7.4.40.0080.00716.72
7.4.30.0100.00616.72
7.4.20.0090.00616.81
7.4.10.0100.00616.84
7.4.00.0100.00416.86
7.3.330.0090.00416.90
7.3.320.0110.00316.49
7.3.310.0090.00516.71
7.3.300.0110.00416.74
7.3.290.0100.00616.69
7.3.280.0100.00616.80
7.3.270.0120.00416.82
7.3.260.0100.00516.69
7.3.250.0110.00516.69
7.3.240.0110.00516.68
7.3.230.0090.00616.67
7.3.220.0110.00516.62
7.3.210.0120.00516.58
7.3.200.0100.00716.63
7.3.190.0110.00616.61
7.3.180.0120.00516.71
7.3.170.0120.00516.66
7.3.160.0090.00716.74
7.3.150.0100.00616.76
7.3.140.0110.00716.65
7.3.130.0110.00516.64
7.3.120.0110.00616.65
7.3.110.0100.00616.61
7.3.100.0120.00516.71
7.3.90.0110.00616.72
7.3.80.0120.00516.65
7.3.70.0100.00616.70
7.3.60.0090.00616.69
7.3.50.0100.00616.70
7.3.40.0110.00416.71
7.3.30.0100.00616.67
7.3.20.0110.00617.42
7.3.10.0130.00517.38
7.3.00.0120.00517.37
7.2.340.0090.00716.84
7.2.330.0110.00716.67
7.2.320.0130.00516.69
7.2.310.0120.00616.84
7.2.300.0130.00516.69
7.2.290.0130.00516.69
7.2.280.0110.00716.72
7.2.270.0110.00716.82
7.2.260.0110.00716.74
7.2.250.0110.00616.72
7.2.240.0130.00516.70
7.2.230.0120.00516.69
7.2.220.0120.00616.69
7.2.210.0130.00416.69
7.2.200.0140.00516.92
7.2.190.0120.00616.88
7.2.180.0120.00516.80
7.2.170.0110.00516.81
7.2.160.0120.00616.92
7.2.150.0130.00617.57
7.2.140.0110.00717.60
7.2.130.0120.00617.68
7.2.120.0110.00717.65
7.2.110.0130.00517.63
7.2.100.0120.00617.65
7.2.90.0130.00617.58
7.2.80.0120.00717.65
7.2.70.0170.00417.63
7.2.60.0110.00817.62
7.2.50.0170.00617.61
7.2.40.0120.00717.62
7.2.30.0130.00617.62
7.2.20.0130.00617.61
7.2.10.0150.00517.69
7.2.00.0140.00717.65

preferences:
25.23 ms | 403 KiB | 5 Q