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.3.60.0150.00016.75
8.3.50.0130.00719.89
8.3.40.0110.00718.66
8.3.30.0040.01118.81
8.3.20.0040.00421.89
8.3.10.0030.00520.21
8.3.00.0040.00419.98
8.2.180.0070.01118.41
8.2.170.0090.00922.96
8.2.160.0000.01420.36
8.2.150.0050.00325.66
8.2.140.0030.00624.66
8.2.130.0040.00419.82
8.2.120.0090.00026.35
8.2.110.0100.00720.52
8.2.100.0090.00317.78
8.2.90.0070.00317.75
8.2.80.0060.00318.90
8.2.70.0030.00617.50
8.2.60.0040.00417.63
8.2.50.0050.00317.63
8.2.40.0070.00020.59
8.2.30.0040.00419.27
8.2.20.0040.00418.02
8.2.10.0050.00318.13
8.2.00.0000.00717.71
8.1.280.0140.00025.92
8.1.270.0000.00721.73
8.1.260.0000.00826.35
8.1.250.0040.00428.09
8.1.240.0040.00423.83
8.1.230.0040.01119.09
8.1.220.0060.00318.60
8.1.210.0060.00318.77
8.1.200.0060.00317.38
8.1.190.0030.00517.35
8.1.180.0060.00318.10
8.1.170.0030.00518.57
8.1.160.0000.00718.83
8.1.150.0030.00320.30
8.1.140.0050.00219.64
8.1.130.0030.00318.91
8.1.120.0000.00717.48
8.1.110.0040.00417.35
8.1.100.0000.00717.45
8.1.90.0000.00717.54
8.1.80.0070.00017.50
8.1.70.0000.00717.48
8.1.60.0030.00517.50
8.1.50.0000.00817.42
8.1.40.0000.00717.42
8.1.30.0080.00017.63
8.1.20.0000.00717.63
8.1.10.0000.00717.58
8.1.00.0000.00717.57
8.0.300.0030.00619.65
8.0.290.0040.00416.75
8.0.280.0000.00718.34
8.0.270.0030.00616.91
8.0.260.0000.00617.36
8.0.250.0080.00016.99
8.0.240.0030.00316.93
8.0.230.0000.00817.04
8.0.220.0040.00416.80
8.0.210.0070.00016.80
8.0.200.0060.00016.97
8.0.190.0000.01116.87
8.0.180.0040.00416.90
8.0.170.0050.00216.98
8.0.160.0000.00816.94
8.0.150.0000.00816.74
8.0.140.0040.00416.88
8.0.130.0030.00313.32
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.330.0050.00315.55
7.4.320.0030.00316.54
7.4.300.0070.00016.61
7.4.290.0070.00016.61
7.4.280.0000.00716.56
7.4.270.0070.00016.51
7.4.260.0030.00616.46
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.330.0000.00613.28
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:
54.06 ms | 401 KiB | 5 Q