3v4l.org

run code in 300+ PHP versions simultaneously
<?php $rows = [ ['cat' => 'guest', 'name' => 'name_one', 'y' => '2016', 'q' => '2', 'st' => 1], ['cat' => 'guest', 'name' => 'name_one', 'y' => '2017', 'q' => '3', 'st' => 2], ['cat' => 'guest', 'name' => 'name_two', 'y' => '2017', 'q' => '1', 'st' => 1], ['cat' => 'guest', 'name' => 'name_two', 'y' => '2017', 'q' => '2', 'st' => 2], ]; $data = []; foreach ($rows as $row) { $link = &$data; foreach (['cat', 'name', 'y'] as $field) { if (!isset($link[$field])) $link[$field] = []; if (!isset($link[$field][$row[$field]])) $link[$field][$row[$field]] = []; $link = &$link[$field][$row[$field]]; } $link[] = ['q' => $row['q'], 'st' => $row['st']]; unset($link); } echo json_encode($data);

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.1rc30.0000.00817.02
8.1rc20.0050.00317.13
8.1rc10.0000.00716.99
8.0.120.0040.00416.71
8.0.110.0040.00416.87
8.0.100.0040.00416.97
8.0.90.0070.00016.88
8.0.80.0040.01116.93
8.0.70.0040.00416.74
8.0.60.0000.00716.95
8.0.50.0030.00516.75
8.0.30.0130.00517.02
8.0.20.0080.01117.41
8.0.10.0040.00417.10
8.0.00.0000.01816.75
7.4.250.0000.00716.59
7.4.240.0070.00016.52
7.4.230.0040.00416.64
7.4.220.0070.01316.71
7.4.210.0050.00916.53
7.4.200.0000.00816.65
7.4.160.0080.00816.51
7.4.150.0100.00717.40
7.4.140.0090.01017.86
7.4.130.0090.00816.46
7.4.120.0130.00716.55
7.4.110.0060.01516.48
7.4.100.0100.00716.44
7.4.90.0100.00616.52
7.4.80.0140.00419.39
7.4.70.0040.01416.37
7.4.60.0020.01416.55
7.4.50.0030.01216.54
7.4.40.0060.01516.51
7.4.30.0070.01016.55
7.4.00.0060.01115.03
7.3.320.0050.00013.32
7.3.310.0070.00016.21
7.3.300.0000.00716.20
7.3.290.0030.00316.25
7.3.280.0110.00916.37
7.3.270.0100.00717.40
7.3.260.0090.01216.71
7.3.250.0120.00716.53
7.3.240.0060.01616.50
7.3.230.0000.01516.25
7.3.210.0130.00316.52
7.3.200.0210.00016.30
7.3.190.0100.01016.46
7.3.180.0030.01216.46
7.3.170.0090.00616.31
7.3.160.0000.01616.32
7.3.120.0110.00714.77
7.3.110.0060.01014.75
7.3.100.0060.01314.71
7.3.90.0120.00014.98
7.3.80.0100.00714.69
7.3.70.0040.01214.61
7.3.60.0080.00514.96
7.3.50.0070.00314.81
7.3.40.0060.00614.86
7.3.30.0000.01614.94
7.3.20.0030.01016.76
7.3.10.0070.00716.40
7.3.00.0120.00716.70
7.2.330.0140.00316.73
7.2.320.0060.01516.75
7.2.310.0140.00716.71
7.2.300.0100.00716.62
7.2.290.0070.01016.93
7.2.250.0060.01215.13
7.2.240.0030.01215.32
7.2.230.0070.00715.40
7.2.220.0090.00915.20
7.2.210.0040.01414.93
7.2.200.0060.01215.01
7.2.190.0000.01615.07
7.2.180.0030.01015.11
7.2.170.0000.01515.06
7.2.130.0170.01016.94
7.2.120.0210.00316.56
7.2.110.0790.01115.80
7.2.100.0610.00715.64
7.2.90.0850.00815.74
7.2.80.0440.01016.08
7.2.70.0890.01015.80
7.2.60.0560.00916.25
7.2.50.0650.00916.08
7.2.40.0680.00515.87
7.2.30.0790.00816.12
7.2.20.0940.00716.01
7.2.10.0790.00715.96
7.2.00.0740.00815.94
7.1.330.0100.00715.69
7.1.320.0040.01115.80
7.1.310.0060.00915.71
7.1.300.0070.01115.96
7.1.290.0080.00415.85
7.1.280.0030.00815.89
7.1.270.0080.00815.85
7.1.260.0030.00915.75
7.1.250.0220.00815.49
7.1.230.1040.01013.91
7.1.220.1670.00713.99
7.1.210.1870.01013.67
7.1.200.0620.00714.87
7.1.190.1290.00313.92
7.1.180.1000.00713.77
7.1.170.1380.01013.90
7.1.160.1120.00713.75
7.1.150.1590.00013.97
7.1.140.1330.00713.85
7.1.130.1600.01014.04
7.1.120.1460.01313.91
7.1.110.1690.01013.99
7.1.100.1050.01013.81
7.1.90.0940.00014.05
7.1.80.0820.00713.90
7.1.70.0430.00315.47
7.1.60.0640.00924.62
7.1.50.1000.00731.96
7.1.40.0800.01931.88
7.1.30.0930.01331.96
7.1.20.1130.01731.36
7.1.10.0370.04219.41
7.1.00.0480.03318.07
7.0.310.1530.00613.58
7.0.300.1100.01013.80
7.0.290.1220.00713.66
7.0.280.1520.01013.66
7.0.270.1190.00913.45
7.0.260.1200.01713.69
7.0.250.1660.00313.49
7.0.240.1080.00613.63
7.0.230.0900.00413.71
7.0.220.0780.01213.65
7.0.210.0890.01013.30
7.0.200.0640.00715.16
7.0.190.1080.00713.73
7.0.180.0770.01313.36
7.0.170.0750.01613.55
7.0.160.0860.00613.28
7.0.150.0450.03317.86
7.0.140.0560.03017.82
7.0.130.0440.02817.69
7.0.120.0460.03217.80
7.0.110.0420.02817.66
7.0.100.0360.03217.74
7.0.90.0320.03717.74
7.0.80.0560.02717.77
7.0.70.0310.03317.79
7.0.60.0350.02717.78
7.0.50.0400.03517.75
7.0.40.0410.03717.69
7.0.30.0380.04017.79
7.0.20.0320.03517.80
7.0.10.0440.02817.66
7.0.00.0400.02817.64
5.6.380.0080.01114.20

preferences:
39.92 ms | 455 KiB | 5 Q