3v4l.org

run code in 300+ PHP versions simultaneously
<?php error_reporting(-1); $db_results = array( array('cat' => 1, 'id' => 1), array('cat' => 1, 'id' => 2), array('cat' => 2, 'id' => 3), array('cat' => 2, 'id' => 4) ); $category_map = array(); foreach ( $db_results as $row ) { $category_map[ $row['cat'] ][] = $row; } print_r($category_map);

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.70.0110.00418.43
8.3.60.0070.01318.43
8.3.50.0110.00722.08
8.3.40.0080.00618.83
8.3.30.0150.00019.09
8.3.20.0030.00620.21
8.3.10.0000.00822.06
8.3.00.0040.00422.53
8.2.190.0040.01116.58
8.2.180.0140.00716.50
8.2.170.0070.00722.96
8.2.160.0060.00620.38
8.2.150.0050.00324.18
8.2.140.0050.00324.66
8.2.130.0120.00626.16
8.2.120.0040.00419.49
8.2.110.0040.00719.22
8.2.100.0090.00319.57
8.2.90.0050.00219.30
8.2.80.0000.00818.16
8.2.70.0060.00317.62
8.2.60.0080.00018.05
8.2.50.0000.01018.07
8.2.40.0080.00018.22
8.2.30.0030.00618.08
8.2.20.0040.00417.65
8.2.10.0000.00717.59
8.2.00.0040.00417.65
8.1.280.0110.00325.92
8.1.270.0040.00422.05
8.1.260.0030.00526.35
8.1.250.0040.00428.09
8.1.240.0030.00620.98
8.1.230.0030.00819.22
8.1.220.0040.00417.74
8.1.210.0040.00418.77
8.1.200.0070.00317.23
8.1.190.0040.00417.40
8.1.180.0040.00418.10
8.1.170.0060.00318.59
8.1.160.0040.00422.02
8.1.150.0050.00218.65
8.1.140.0000.00717.46
8.1.130.0050.00217.71
8.1.120.0070.00017.39
8.1.110.0040.00417.48
8.1.100.0000.00717.38
8.1.90.0070.00017.34
8.1.80.0040.00417.39
8.1.70.0000.00717.43
8.1.60.0040.00417.49
8.1.50.0070.00017.43
8.1.40.0030.00517.45
8.1.30.0000.00817.56
8.1.20.0040.00417.60
8.1.10.0040.00417.41
8.1.00.0040.00417.45
8.0.300.0040.00418.77
8.0.290.0000.00817.18
8.0.280.0070.00018.36
8.0.270.0030.00317.18
8.0.260.0000.00616.95
8.0.250.0070.00017.02
8.0.240.0000.00716.89
8.0.230.0040.00416.80
8.0.220.0000.00716.92
8.0.210.0030.00316.87
8.0.200.0030.00316.95
8.0.190.0030.00516.98
8.0.180.0000.00716.96
8.0.170.0050.00216.91
8.0.160.0000.00716.80
8.0.150.0000.00716.76
8.0.140.0050.00316.89
8.0.130.0000.00613.31
8.0.120.0040.00416.93
8.0.110.0030.00316.76
8.0.100.0050.00316.88
8.0.90.0070.00016.77
8.0.80.0060.00916.91
8.0.70.0050.00316.68
8.0.60.0000.00716.94
8.0.50.0000.00716.85
8.0.30.0070.01316.90
8.0.20.0150.00517.40
8.0.10.0030.00616.96
8.0.00.0130.00516.81
7.4.330.0000.00715.00
7.4.320.0000.00716.53
7.4.300.0000.00716.54
7.4.290.0050.00316.53
7.4.280.0070.00016.60
7.4.270.0050.00316.53
7.4.260.0040.00416.52
7.4.250.0050.00216.55
7.4.240.0010.00616.55
7.4.230.0030.00316.65
7.4.220.0040.01416.64
7.4.210.0100.00516.60
7.4.200.0030.00316.63
7.4.190.0040.00416.48
7.4.160.0090.01216.60
7.4.150.0110.00617.40
7.4.140.0120.00617.86
7.4.130.0170.00316.55
7.4.120.0080.00816.53
7.4.110.0090.00916.56
7.4.100.0130.01016.42
7.4.90.0090.01016.32
7.4.80.0100.00719.39
7.4.70.0070.01016.50
7.4.60.0060.01516.46
7.4.50.0030.00316.57
7.4.40.0000.01222.77
7.4.30.0100.00716.67
7.4.00.0100.00715.18
7.3.330.0000.00513.17
7.3.320.0000.00513.25
7.3.310.0090.00016.32
7.3.300.0070.00016.29
7.3.290.0050.00816.28
7.3.280.0100.00816.33
7.3.270.0100.01417.40
7.3.260.0150.00316.43
7.3.250.0090.00916.55
7.3.240.0060.01016.36
7.3.230.0090.00716.39
7.3.210.0120.00616.51
7.3.200.0030.01319.39
7.3.190.0060.01216.29
7.3.180.0070.00716.39
7.3.170.0090.01216.27
7.3.160.0120.00616.38
7.3.120.0080.00815.06
7.3.10.0000.01016.72
7.3.00.0070.00316.87
7.2.330.0030.01316.66
7.2.320.0040.01516.46
7.2.310.0130.00916.69
7.2.300.0100.00716.53
7.2.290.0090.01216.65
7.2.130.0000.01116.98
7.2.120.0090.00616.58
7.2.110.0060.00316.87
7.2.100.0030.00716.79
7.2.90.0040.00816.80
7.2.80.0140.00816.61
7.2.70.0030.00917.10
7.2.60.0060.00617.08
7.2.50.0070.00316.79
7.2.40.0000.00816.67
7.2.30.0100.00316.71
7.2.20.0030.00616.77
7.2.10.0140.00016.90
7.2.00.0000.01218.13
7.1.250.0090.00315.90
7.1.200.0130.00715.82
7.1.100.0000.01118.34
7.1.70.0000.01117.09
7.1.60.0110.01419.82
7.1.50.0070.01717.11
7.1.00.0070.07322.30
7.0.200.0000.01416.32
7.0.140.0100.06721.95
7.0.60.0030.07719.97
7.0.50.0100.08017.86
7.0.40.0030.04320.26
7.0.30.0270.07720.10
7.0.20.0330.06720.05
7.0.10.0000.05720.15
7.0.00.0130.08320.09
5.6.280.0030.07021.10
5.6.210.0170.05020.56
5.6.200.0000.08018.29
5.6.190.0100.05320.52
5.6.180.0430.05020.75
5.6.170.0270.07720.46
5.6.160.0230.06020.52
5.6.150.0070.08018.21
5.6.140.0070.04318.28
5.6.130.0100.07718.13
5.6.120.0100.04021.09
5.6.110.0130.06720.97
5.6.100.0170.06021.11
5.6.90.0000.08020.99
5.6.80.0130.07320.50
5.5.350.0300.05720.32
5.5.340.0170.06317.98
5.5.330.0100.08320.46
5.5.320.0430.06720.34
5.5.310.0170.04720.30
5.5.300.0070.06717.98
5.5.290.0000.04317.98
5.5.280.0130.08320.73
5.5.270.0070.05020.86
5.5.260.0000.04720.76
5.5.250.0000.08320.78
5.5.240.0070.07720.15
5.4.450.1100.05719.38
5.4.440.0800.07019.60
5.4.430.0200.04319.52
5.4.420.0130.05319.54
5.4.410.0200.07718.91
5.4.400.0170.05718.53
5.4.390.0230.06718.74
5.4.380.0100.06018.60
5.4.370.0270.05018.80
5.4.360.0200.05018.74
5.4.350.0300.04718.52
5.4.340.0230.04718.51
5.4.320.0040.03912.48
5.4.310.0040.04512.48
5.4.300.0080.03712.48
5.4.290.0050.03912.48
5.4.280.0070.03512.38
5.4.270.0230.04718.83
5.4.260.0070.06018.77
5.4.250.0130.05318.93
5.4.240.0100.05018.83
5.4.230.0130.06318.80
5.4.220.0130.05719.02
5.4.210.0070.06318.79
5.4.200.0030.05718.93
5.4.190.0200.06318.93
5.4.180.0100.06718.82
5.4.170.0170.05018.75
5.4.160.0170.05718.78
5.4.150.0100.07718.89
5.4.140.0130.05716.28
5.4.130.0170.04316.40
5.4.120.0170.06316.41
5.4.110.0030.06016.50
5.4.100.0230.05016.48
5.4.90.0100.05016.49
5.4.80.0200.06316.63
5.4.70.0100.05316.31
5.4.60.0230.05316.45
5.4.50.0130.05316.45
5.4.40.0130.05316.54
5.4.30.0100.05716.62
5.4.20.0130.06316.41
5.4.10.0170.07016.48
5.4.00.0100.04315.89
5.3.290.0020.04312.80
5.3.280.0230.05014.75
5.3.270.0030.06314.57
5.3.260.0070.05714.66
5.3.250.0130.05014.68
5.3.240.0100.08014.58
5.3.230.0100.08014.42
5.3.220.0100.07014.70
5.3.210.0100.05314.53
5.3.200.0070.05714.62
5.3.190.0030.08014.74
5.3.180.0130.07014.52
5.3.170.0170.06014.38
5.3.160.0130.06714.64
5.3.150.0100.05014.46
5.3.140.0100.05014.45
5.3.130.0130.06314.52
5.3.120.0130.04714.63
5.3.110.0230.04314.44
5.3.100.0130.06014.03
5.3.90.0130.05713.99
5.3.80.0070.05714.19
5.3.70.0100.05313.99
5.3.60.0070.06013.96
5.3.50.0070.05714.16
5.3.40.0070.05013.93
5.3.30.0070.07014.08
5.3.20.0130.04313.76
5.3.10.0030.07713.63
5.3.00.0000.06013.66
5.2.170.0130.05311.20
5.2.160.0070.05311.13
5.2.150.0100.04311.13
5.2.140.0030.06711.09
5.2.130.0130.03311.27
5.2.120.0100.03711.17
5.2.110.0100.05311.18
5.2.100.0100.05711.04
5.2.90.0030.06010.92
5.2.80.0130.04711.05
5.2.70.0100.05711.16
5.2.60.0170.04011.00
5.2.50.0070.06010.98
5.2.40.0200.04011.05
5.2.30.0100.05710.92
5.2.20.0070.04010.92
5.2.10.0070.03711.03
5.2.00.0100.03710.61
5.1.60.0100.03010.08
5.1.50.0030.04010.05
5.1.40.0030.03310.06
5.1.30.0000.06010.15
5.1.20.0070.03310.42
5.1.10.0030.04010.05
5.1.00.0030.0379.98
5.0.50.0030.0408.50
5.0.40.0070.0278.49
5.0.30.0070.0408.20
5.0.20.0070.0308.16
5.0.10.0100.0238.23
5.0.00.0100.0378.11
4.4.90.0070.0336.90
4.4.80.0100.0136.90
4.4.70.0030.0206.90
4.4.60.0000.0276.90
4.4.50.0100.0136.90
4.4.40.0000.0476.90
4.4.30.0170.0176.90
4.4.20.0000.0276.90
4.4.10.0030.0276.90
4.4.00.0070.0406.90
4.3.110.0030.0236.90
4.3.100.0070.0276.90
4.3.90.0070.0276.90
4.3.80.0030.0436.90
4.3.70.0100.0206.90
4.3.60.0030.0306.90
4.3.50.0030.0336.90
4.3.40.0100.0276.90
4.3.30.0070.0206.90
4.3.20.0200.0236.90
4.3.10.0070.0176.90
4.3.00.0130.0236.63

preferences:
41 ms | 401 KiB | 5 Q