3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getTotalHours($companyName) { return ['Company_A' => '20h 45m', 'Company_B' => '7h 30m'][$companyName]; } $array = [ ['user_id' => 255, 'display_name' => 'Mark', 'company_name' => 'Company_A'], ['user_id' => 150, 'display_name' => 'Paul', 'company_name' => 'Company_A'], ['user_id' => 25, 'display_name' => 'Hulk', 'company_name' => 'Company_B'], ['user_id' => 50, 'display_name' => 'Bob', 'company_name' => 'Company_B'], ]; $result = []; foreach ($array as $row) { $cn = $row['company_name']; unset($row['company_name']); $result[$cn]['company_total_hours'] ??= getTotalHours($cn); $result[$cn]['employees'][] = $row; } var_export($result);

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.10.0070.00316.82
8.5.00.0150.00820.08
8.4.160.0120.01125.91
8.4.150.0020.00114.05
8.4.140.0130.00917.54
8.4.130.0030.00717.78
8.4.120.0120.00820.53
8.4.110.0120.00920.70
8.4.100.0080.00317.69
8.4.90.0150.00517.89
8.4.80.0210.00819.27
8.4.70.0190.00619.24
8.4.60.0470.00617.35
8.4.50.0420.00817.70
8.4.40.0230.00717.41
8.4.30.0190.00617.38
8.4.20.0210.00417.53
8.4.10.0200.00717.54
8.3.280.0110.01018.40
8.3.270.0110.00916.64
8.3.260.0090.00916.91
8.3.250.0100.00919.10
8.3.240.0080.00716.56
8.3.230.0130.00516.58
8.3.220.0080.00416.97
8.3.210.0100.00616.97
8.3.200.0160.00516.97
8.3.190.0320.00616.97
8.3.180.0360.00616.97
8.3.170.0400.01216.97
8.3.160.0290.00316.97
8.3.150.0210.00416.97
8.3.140.0200.00316.97
8.3.130.0300.01116.97
8.3.120.0230.00716.97
8.3.110.0290.00516.97
8.3.100.0260.00516.97
8.3.90.0450.00616.97
8.3.80.0230.00516.97
8.3.70.0270.00916.97
8.3.60.0210.00316.97
8.3.50.0200.00316.97
8.3.40.0370.00817.34
8.3.30.0230.00317.54
8.3.20.0130.00617.51
8.3.10.0300.00917.67
8.3.00.0130.00719.32
8.2.290.0090.00919.00
8.2.280.0280.01016.97
8.2.270.0340.00916.97
8.2.260.0350.00616.97
8.2.250.0300.01016.97
8.2.240.0320.00416.97
8.2.230.0320.00716.97
8.2.220.0330.01116.97
8.2.210.0330.00816.97
8.2.200.0340.00916.97
8.2.190.0340.00816.97
8.2.180.0330.00716.97
8.2.170.0360.00917.73
8.2.160.0440.00617.80
8.2.150.0390.00917.42
8.2.140.0370.00817.64
8.2.130.0380.00617.65
8.2.120.0370.00717.71
8.2.110.0220.00617.57
8.2.100.0260.00617.44
8.2.90.0180.00517.61
8.2.80.0170.00417.43
8.2.70.0450.00617.54
8.2.60.0330.00817.36
8.2.50.0300.01017.66
8.2.40.0300.01017.65
8.2.30.0310.01017.39
8.2.20.0300.00917.52
8.2.10.0350.00617.49
8.2.00.0330.00817.61

preferences:
45.12 ms | 403 KiB | 5 Q