3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ ['department' => 'Sale', 'month' => 'February', 'value' => 50], ['department' => 'Sale', 'month' => 'March', 'value' => 35], ['department' => 'Sale', 'month' => 'April', 'value' => 65], ['department' => 'Sale', 'month' => 'May', 'value' => 120], ['department' => 'Dispatch', 'month' => 'February', 'value' => 85], ['department' => 'Dispatch', 'month' => 'March', 'value' => 23], ['department' => 'Dispatch', 'month' => 'April', 'value' => 45], ['department' => 'Dispatch', 'month' => 'May', 'value' => 33], ]; $columns = ['Sale', 'Dispatch', 'Support', 'Calibration']; $columnLookup = array_flip($columns); $result = []; foreach ($array as $row) { $rowKey = $row['month']; $colKey = $columnLookup[$row['department']]; $result[$rowKey][$colKey] = $row['value']; } //var_export($result); foreach ($result as $month => $colVals) { printf( "%' 10s\t%d\t%d\t%d\t%d\n", $month, $colVals[0] ?? 0, $colVals[1] ?? 0, $colVals[2] ?? 0, $colVals[3] ?? 0 ); }

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.0130.00818.59
8.4.120.0140.00717.54
8.4.110.0160.00620.62
8.4.100.0120.00917.86
8.4.90.0100.01022.44
8.4.80.0120.00720.46
8.4.70.0050.00417.80
8.4.60.0110.01019.00
8.4.50.0130.00718.99
8.4.40.0030.01620.50
8.4.30.0160.00323.83
8.4.20.0160.00319.61
8.4.10.0120.00322.21
8.3.260.0110.00916.51
8.3.250.0050.00416.54
8.3.240.0030.00516.83
8.3.230.0110.00816.66
8.3.220.0080.00618.84
8.3.210.0040.00416.64
8.3.200.0040.00416.64
8.3.190.0130.00617.41
8.3.180.0090.01016.56
8.3.170.0140.00418.88
8.3.160.0070.01117.29
8.3.150.0150.00317.25
8.3.140.0110.00716.65
8.3.130.0090.00016.77
8.3.120.0070.00318.70
8.3.110.0030.00620.94
8.3.100.0090.00024.06
8.3.90.0030.00526.77
8.3.80.0030.00618.56
8.3.70.0170.00316.50
8.3.60.0240.00722.91
8.3.50.0040.01416.73
8.3.40.0130.00721.70
8.3.30.0150.00818.71
8.3.20.0040.00424.18
8.3.10.0060.00324.66
8.3.00.0040.00426.16
8.2.290.0120.00716.58
8.2.280.0140.00518.32
8.2.270.0160.00317.26
8.2.260.0040.00418.59
8.2.250.0040.00416.66
8.2.240.0090.00017.10
8.2.230.0030.00722.58
8.2.220.0040.00437.54
8.2.210.0110.00726.77
8.2.200.0090.00018.16
8.2.190.0110.01116.88
8.2.180.0060.01016.50
8.2.170.0100.01018.99
8.2.160.0150.00322.96
8.2.150.0060.00325.66
8.2.140.0080.00024.66
8.2.130.0080.00026.16
8.2.120.0060.00320.07
8.2.110.0040.00421.02
8.2.100.0120.00317.72
8.2.90.0050.00319.09
8.2.80.0050.00317.97
8.2.70.0090.00017.50
8.2.60.0180.00317.38
8.2.50.0090.01017.25
8.2.40.0190.00017.50
8.2.30.0100.01117.25
8.2.20.0170.00317.49
8.2.10.0170.00417.13
8.2.00.0120.00917.48
8.1.330.0100.00816.14
8.1.320.0120.00716.15
8.1.310.0080.00016.56
8.1.300.0180.00017.84
8.1.290.0090.00030.84
8.1.280.0080.00825.92
8.1.270.0040.00424.66
8.1.260.0050.00326.35
8.1.250.0040.00428.09
8.1.240.0130.00322.10
8.1.230.0100.00017.70
8.1.220.0040.00417.78
8.1.210.0000.00818.77
8.1.200.0030.00717.35
8.1.190.0060.00317.35
8.1.180.0100.00817.00
8.1.170.0130.00317.11
8.1.160.0120.00417.25
8.1.150.0080.00817.23
8.1.140.0180.00017.11
8.1.130.0090.00917.13
8.1.120.0070.01217.13
8.1.110.0080.00817.00
8.1.100.0160.00317.00
8.1.90.0030.01317.38
8.1.80.0150.00216.97
8.1.70.0090.00717.25
8.1.60.0140.00617.48
8.1.50.0160.00217.25
8.1.40.0160.00417.50
8.1.30.0130.00717.38
8.1.20.0090.01017.50
8.1.10.0140.00517.13
8.1.00.0180.00016.97
8.0.300.0030.00518.77
8.0.290.0050.00316.63
8.0.280.0140.00516.52
8.0.270.0090.00916.52
8.0.260.0170.00016.52
8.0.250.0140.00316.52
8.0.240.0130.00416.52
8.0.230.0140.00416.52
8.0.220.0160.00016.52
8.0.210.0110.00416.63
8.0.200.0110.00616.52
8.0.190.0160.00016.52
8.0.180.0180.00016.52
8.0.170.0110.00716.86
8.0.160.0190.00016.52
8.0.150.0120.00616.52
8.0.140.0110.00516.63
8.0.130.0130.00316.63
8.0.120.0080.00816.75
8.0.110.0120.00416.52
8.0.100.0180.00016.52
8.0.90.0170.00016.63
8.0.80.0150.00416.75
8.0.70.0160.00016.63
8.0.60.0130.00416.63
8.0.50.0120.00416.52
8.0.30.0060.01116.75
8.0.20.0080.00816.63
8.0.10.0120.00416.73

preferences:
67.33 ms | 403 KiB | 5 Q