3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = array( 0 => array('id' => 8, 'month' => 1, 'cost' => 12500), 1 => array('id' => 8, 'month' => 2, 'cost' => 14200), 2 => array('id' => 9, 'month' => 1, 'cost' => 23000), 3 => array('id' => 9, 'month' => 2, 'cost' => 18000), ); $by_id = []; foreach($data as $x) { $by_id[$x['id']][$x['month']] = $x['cost']; // e.g. $by_id[8][2] = 14200; } $html = []; $html[] = '<table>'; $html[] = '<tr><th>ID</th><th>Jan</th><th>Feb</th></tr>'; foreach($by_id as $id => $months) { $html[] = '<tr>'; $html[] = "<td>{$id}</td>"; foreach($months as $month => $cost) { $html[] = "<td>{$cost}</td>"; } $html[] = '</tr>'; } $html[] = '</table>'; echo implode("\n", $html);

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.30.0110.00717.36
8.5.20.0110.00819.64
8.5.10.0120.00621.91
8.5.00.0100.01119.97
8.4.180.0130.00919.80
8.4.170.0100.01123.97
8.4.160.0100.01123.93
8.4.150.0080.00516.83
8.4.140.0130.00817.87
8.4.130.0070.00218.54
8.4.120.0140.00524.05
8.4.110.0130.00518.90
8.4.100.0130.00719.13
8.4.90.0060.00320.67
8.4.80.0040.00618.87
8.4.70.0120.00918.91
8.4.60.0050.00420.28
8.4.50.0060.00220.47
8.4.40.0130.00717.73
8.4.30.0100.01018.75
8.4.20.0030.01717.82
8.4.10.0000.00923.94
8.3.300.0120.00920.86
8.3.290.0120.00820.82
8.3.280.0150.00618.55
8.3.270.0150.00816.47
8.3.260.0100.00916.56
8.3.250.0100.00919.12
8.3.240.0090.01117.28
8.3.230.0160.00416.76
8.3.220.0040.00419.05
8.3.210.0100.00916.64
8.3.200.0090.00916.89
8.3.190.0080.00717.15
8.3.180.0040.00418.86
8.3.170.0060.01217.32
8.3.160.0110.00718.51
8.3.150.0130.00616.85
8.3.140.0070.00316.63
8.3.130.0050.00316.79
8.3.120.0040.01219.09
8.3.110.0000.00820.94
8.3.100.0050.00324.06
8.3.90.0030.00726.77
8.3.80.0040.00416.50
8.3.70.0090.00616.75
8.3.60.0040.01118.14
8.3.50.0140.00018.10
8.3.40.0140.00020.47
8.3.30.0120.00318.84
8.3.20.0000.00724.18
8.3.10.0040.00424.66
8.3.00.0080.00026.16
8.2.300.0110.01118.81
8.2.290.0060.00620.68
8.2.280.0030.00618.26
8.2.270.0160.00316.41
8.2.260.0060.01317.20
8.2.250.0130.00316.57
8.2.240.0070.01018.84
8.2.230.0030.00622.58
8.2.220.0090.00037.54
8.2.210.0140.00426.77
8.2.200.0030.00618.54
8.2.190.0090.00916.58
8.2.180.0100.00625.92
8.2.170.0140.00418.95
8.2.160.0100.00722.96
8.2.150.0080.00025.66
8.2.140.0080.00024.66
8.2.130.0030.00626.16
8.2.120.0080.00026.16
8.2.110.0000.00920.97
8.2.100.0080.00418.03
8.2.90.0080.00019.21
8.2.80.0000.00917.97
8.2.70.0030.00717.49
8.2.60.0040.00417.93
8.2.50.0040.00418.07
8.2.40.0030.00618.34
8.2.30.0000.00818.15
8.2.20.0000.00919.20
8.2.10.0040.00418.01
8.2.00.0000.00719.40
8.1.340.0080.01119.84
8.1.330.0110.00821.94
8.1.320.0110.00816.32
8.1.310.0110.00716.68
8.1.300.0030.00618.60
8.1.290.0030.00630.84
8.1.280.0000.01425.92
8.1.270.0050.00224.66
8.1.260.0070.00026.35
8.1.250.0050.00228.09
8.1.240.0000.00922.54
8.1.230.0080.00419.10
8.1.220.0040.00717.79
8.1.210.0040.00418.77
8.1.200.0060.00317.34
8.1.190.0080.00017.35
8.1.180.0030.00618.10
8.1.170.0000.01018.50
8.1.160.0020.00519.07
8.1.150.0080.00018.64
8.1.140.0020.00517.52
8.1.130.0000.00718.91
8.1.120.0040.00417.36
8.1.110.0000.00717.47
8.1.100.0020.00517.50
8.1.90.0050.01117.49
8.1.80.0090.00617.29
8.1.70.0140.00017.34
8.1.60.0110.00317.52
8.1.50.0090.00917.52
8.1.40.0130.00317.53
8.1.30.0040.00817.44
8.1.20.0100.00217.65
8.1.10.0040.00717.59
8.1.00.0150.00317.52
8.0.300.0070.00018.77
8.0.290.0040.00416.75
8.0.280.0070.00018.47
8.0.270.0040.00416.84
8.0.260.0080.00018.36
8.0.250.0070.00016.92
8.0.240.0070.00017.02
8.0.230.0030.00416.99
8.0.220.0150.00016.88
8.0.210.0060.00916.88
8.0.200.0090.00516.92
8.0.190.0160.00016.96
8.0.180.0160.00016.76
8.0.170.0100.00516.88
8.0.160.0100.00516.82
8.0.150.0100.00516.88
8.0.140.0070.00716.82
8.0.130.0100.00516.90
8.0.120.0050.01016.91
8.0.110.0110.00516.91
8.0.100.0090.00616.75
8.0.90.0050.01016.79
8.0.80.0050.01016.90
8.0.70.0080.00816.89
8.0.60.0080.00816.86
8.0.50.0050.01016.88
8.0.30.0100.00516.88
8.0.20.0160.00016.97
8.0.10.0160.00016.85
7.4.330.0000.00515.55
7.4.320.0000.00716.53
7.4.300.0170.00016.65
7.4.290.0140.00316.51
7.4.280.0040.01416.61
7.4.270.0110.00616.41
7.4.260.0060.00916.61
7.4.250.0150.00316.63
7.4.240.0170.00016.69
7.4.230.0120.00416.47
7.4.220.0110.00516.60
7.4.210.0120.00316.50
7.4.200.0090.00616.57
7.4.190.0060.00916.48
7.4.180.0050.01016.61
7.4.160.0070.00716.58
7.4.150.0040.01116.49
7.4.140.0040.01116.45
7.4.130.0090.00616.51
7.4.120.0070.00716.37
7.4.110.0150.00016.45
7.4.100.0120.00416.54
7.4.90.0130.00016.32
7.4.80.0050.00516.52
7.4.70.0040.00416.32
7.4.60.0020.00516.51
7.4.50.0040.00416.31
7.4.40.0040.00416.45
7.4.30.0030.00316.59
7.4.20.0030.00316.45
7.4.10.0040.00416.44
7.4.00.0000.00616.49

preferences:
44.75 ms | 1272 KiB | 5 Q