3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ ['Categoria' => 'example', 'Servico' => 'name1'], ['Categoria' => 'example', 'Servico' => 'name2'], ['Categoria' => 'example', 'Servico' => 'name3'], ['Categoria' => 'example2', 'Servico' => 'name4'], ['Categoria' => 'example2', 'Servico' => 'name5'], ['Categoria' => 'example2', 'Servico' => 'name6'], ['Categoria' => 'example3', 'Servico' => 'name7'], ['Categoria' => 'example3', 'Servico' => 'name8'], ['Categoria' => 'example3', 'Servico' => 'name9'] ]; $result = []; foreach ($array as $row) { $result[$row['Categoria']]['Servico'] = $row['Categoria']; $result[$row['Categoria']]['children'][] = $row['Servico']; } var_export(array_values($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.4.140.0140.00817.80
8.4.130.0080.00917.59
8.4.120.0120.00424.27
8.4.110.0130.00822.17
8.4.100.0090.00817.75
8.4.90.0120.00817.99
8.4.80.0060.00319.47
8.4.70.0110.00817.85
8.4.60.0140.00518.82
8.4.50.0110.00923.82
8.4.40.0030.01619.41
8.4.30.0130.00920.36
8.4.20.0160.00318.76
8.4.10.0060.01517.63
8.3.270.0060.01416.88
8.3.260.0120.00716.82
8.3.250.0100.00718.88
8.3.240.0140.00517.13
8.3.230.0080.00816.48
8.3.220.0080.00016.57
8.3.210.0140.00416.53
8.3.200.0040.01116.76
8.3.190.0110.01117.16
8.3.180.0100.00417.21
8.3.170.0070.01017.33
8.3.160.0130.00618.22
8.3.150.0060.01216.88
8.3.140.0080.00016.54
8.3.130.0050.00318.49
8.3.120.0060.00320.64
8.3.110.0000.00916.50
8.3.100.0100.01016.62
8.3.90.0090.00626.77
8.3.80.0060.00319.36
8.3.70.0120.00918.27
8.3.60.0090.01216.50
8.3.50.0070.00718.02
8.3.40.0040.01118.77
8.3.30.0090.00618.53
8.3.20.0000.00724.18
8.3.10.0040.00424.66
8.3.00.0050.00226.16
8.2.290.0020.00620.18
8.2.280.0090.00518.15
8.2.270.0040.01417.05
8.2.260.0090.00918.52
8.2.250.0080.00016.62
8.2.240.0100.00317.43
8.2.230.0060.00320.94
8.2.220.0080.01124.06
8.2.210.0100.00026.77
8.2.200.0090.00318.88
8.2.190.0120.00318.43
8.2.180.0040.01125.92
8.2.170.0120.00319.11
8.2.160.0140.00022.96
8.2.150.0070.00025.66
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0000.00726.35
8.2.110.0060.00322.08
8.2.100.0090.00917.75
8.2.90.0000.00819.17
8.2.80.0030.00617.97
8.2.70.0030.00717.63
8.2.60.0030.00618.05
8.2.50.0030.00518.07
8.2.40.0030.00518.35
8.2.30.0040.00418.19
8.2.20.0050.00218.11
8.2.10.0040.00419.32
8.2.00.0000.00819.40
8.1.330.0130.00622.11
8.1.320.0130.00616.25
8.1.310.0080.00018.80
8.1.300.0040.00416.17
8.1.290.0030.00730.84
8.1.280.0060.00925.92
8.1.270.0040.00423.99
8.1.260.0000.00728.09
8.1.250.0040.00428.09
8.1.240.0090.00020.77
8.1.230.0060.00617.76
8.1.220.0050.00317.77
8.1.210.0030.00618.77
8.1.200.0060.00317.48
8.1.190.0000.00817.35
8.1.180.0040.00418.10
8.1.170.0040.00418.84
8.1.160.0030.00518.89
8.1.150.0000.00718.90
8.1.140.0040.00418.89
8.1.130.0030.00320.21
8.1.120.0040.00417.45
8.1.110.0040.00417.45
8.1.100.0050.00217.42
8.1.90.0050.00517.48
8.1.80.0030.00617.41
8.1.70.0030.00717.49
8.1.60.0050.00317.49
8.1.50.0000.00817.52
8.1.40.0000.01017.53
8.1.30.0040.00417.57
8.1.20.0060.00317.55
8.1.10.0040.00417.48
8.1.00.0090.00017.44
8.0.300.0070.00018.77
8.0.290.0080.00016.75
8.0.280.0050.00218.34
8.0.270.0030.00618.12
8.0.260.0060.00018.36
8.0.250.0080.00016.95
8.0.240.0050.00316.98
8.0.230.0000.00716.99
8.0.220.0060.00316.76
8.0.210.0000.00716.91
8.0.200.0030.00316.86
8.0.190.0040.00416.89
8.0.180.0040.00416.92
8.0.170.0100.00016.88
8.0.160.0050.00316.98
8.0.150.0090.00316.73
8.0.140.0030.00516.82
8.0.130.0050.00013.26
8.0.120.0000.00816.88
8.0.110.0070.00016.91
8.0.100.0040.00416.71
8.0.90.0000.00716.70
8.0.80.0040.01416.87
8.0.70.0070.00017.01
8.0.60.0030.00516.89
8.0.50.0080.00016.93
8.0.30.0080.00816.81
8.0.20.0090.00617.01
8.0.10.0030.01316.95
8.0.00.0060.01117.09
7.4.330.0030.00315.55
7.4.320.0030.00316.47
7.4.300.0060.00016.54
7.4.290.0040.00416.30
7.4.280.0040.00416.65
7.4.270.0040.00416.66
7.4.260.0000.00513.35
7.4.250.0000.00816.55
7.4.240.0050.00216.59
7.4.230.0080.00016.51
7.4.220.0020.00516.54
7.4.210.0050.00816.56
7.4.200.0030.00316.59
7.4.160.0090.00616.49
7.4.150.0120.00616.47
7.4.140.0130.00616.64
7.4.130.0120.00416.51
7.4.120.0060.01216.48
7.4.110.0040.01116.62
7.4.100.0130.00616.63
7.4.90.0060.01016.46
7.4.80.0070.00716.42
7.4.70.0040.01116.32
7.4.60.0040.01116.30
7.4.50.0040.01116.39
7.4.40.0100.00616.43
7.4.30.0070.00716.57
7.4.20.0070.01316.54
7.4.10.0160.00016.55
7.4.00.0030.01416.51
7.3.330.0070.00016.42
7.3.320.0000.00513.04
7.3.310.0000.00716.49
7.3.300.0030.00316.33
7.3.290.0090.00816.37
7.3.270.0150.00016.35
7.3.260.0130.00316.32
7.3.250.0070.01016.29
7.3.240.0040.01116.35
7.3.230.0100.00716.36
7.3.220.0090.00616.24
7.3.210.0030.01316.32
7.3.200.0060.00916.20
7.3.190.0070.00716.24
7.3.180.0130.00616.26
7.3.170.0120.00316.36
7.3.160.0120.00616.29
7.3.150.0160.00316.34
7.3.140.0040.01116.29
7.3.130.0060.00916.27
7.3.120.0070.01016.22
7.3.110.0110.00616.25
7.3.100.0070.00716.08
7.3.90.0000.01316.55
7.3.80.0100.01016.32
7.3.70.0100.01016.37
7.3.60.0110.00416.38
7.3.50.0030.01216.55
7.3.40.0030.01616.43
7.3.30.0120.00416.45
7.3.20.0130.00316.50
7.3.10.0190.00616.35
7.3.00.0140.00316.35

preferences:
47.09 ms | 403 KiB | 5 Q