3v4l.org

run code in 300+ PHP versions simultaneously
<?php $stores = [ 0 => "store3", 1 => "store", 2 => "store2" ]; $products = [ 0 => [ "store" => "store", "product" => "1" ], 1 => [ "store" => "store", "product" => "4" ], 2 => [ "store" => "store2", "product" => "2" ], 3 => [ "store" => "store2", "product" => "3" ], 4 => [ "store" => "store3", "product" => "7" ], 5 => [ "store" => "store3", "product" => "11" ] ]; $array = []; array_walk($products, function ($value, $key) use ($stores, &$array) { $array[$value['store']][] = $value['product']; }); print_r($array);

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.00.0100.01119.81
8.4.150.0030.00014.05
8.4.140.0130.00717.61
8.4.130.0090.00518.02
8.4.120.0110.00820.40
8.4.110.0040.00520.51
8.4.100.0130.00517.83
8.4.90.0130.00817.73
8.4.80.0070.00517.82
8.4.70.0130.00519.51
8.4.60.0100.01018.73
8.4.50.0070.00318.94
8.4.40.0100.01022.38
8.4.30.0060.00319.79
8.4.20.0090.00018.70
8.4.10.0040.00717.60
8.3.280.0030.00014.05
8.3.270.0090.01116.73
8.3.260.0080.00816.60
8.3.250.0140.00418.76
8.3.240.0130.00616.71
8.3.230.0110.00816.55
8.3.220.0120.00717.15
8.3.210.0130.00716.53
8.3.200.0050.00416.55
8.3.190.0100.00816.55
8.3.180.0050.00518.34
8.3.170.0060.00319.01
8.3.160.0090.01020.70
8.3.150.0120.00618.48
8.3.140.0090.00016.71
8.3.130.0060.00318.21
8.3.120.0000.01918.86
8.3.110.0050.00518.31
8.3.100.0080.00024.06
8.3.90.0110.00716.62
8.3.80.0080.00418.14
8.3.70.0090.01216.50
8.3.60.0070.01118.30
8.3.50.0110.01121.15
8.3.40.0110.00418.73
8.3.30.0120.00418.89
8.3.20.0080.00019.78
8.3.10.0090.00020.57
8.3.00.0080.00023.66
8.2.290.0090.01219.12
8.2.280.0060.00618.28
8.2.270.0130.00617.01
8.2.260.0090.00916.42
8.2.250.0120.00618.50
8.2.240.0130.00317.16
8.2.230.0060.00320.94
8.2.220.0080.00037.54
8.2.210.0070.00026.77
8.2.200.0030.00618.29
8.2.190.0130.00316.78
8.2.180.0180.00418.29
8.2.170.0080.00822.96
8.2.160.0100.00320.38
8.2.150.0070.00024.18
8.2.140.0040.00424.66
8.2.130.0080.00020.35
8.2.120.0040.00426.35
8.2.110.0040.00422.15
8.2.100.0060.00619.38
8.2.90.0040.00419.47
8.2.80.0000.00720.53
8.2.70.0030.00617.63
8.2.60.0000.00918.05
8.2.50.0060.00318.07
8.2.40.0000.00717.98
8.2.30.0050.00318.19
8.2.20.0060.00318.11
8.2.10.0040.00418.18
8.2.00.0000.00718.19
8.1.330.0090.00816.09
8.1.320.0070.00216.02
8.1.310.0100.00316.42
8.1.300.0000.00818.59
8.1.290.0070.00318.88
8.1.280.0130.00325.92
8.1.270.0000.00820.64
8.1.260.0090.00026.35
8.1.250.0040.00428.09
8.1.240.0040.00423.92
8.1.230.0100.00320.89
8.1.220.0090.00017.76
8.1.210.0040.00419.03
8.1.200.0040.00417.23
8.1.190.0080.00017.23
8.1.180.0060.00318.10
8.1.170.0000.01118.65
8.1.160.0000.00818.75
8.1.150.0030.00320.31
8.1.140.0020.00519.57
8.1.130.0040.00417.45
8.1.120.0000.00717.49
8.1.110.0000.00817.48
8.1.100.0000.00817.45
8.1.90.0030.00317.29
8.1.80.0000.00717.52
8.1.70.0000.00717.50
8.1.60.0060.00317.59
8.1.50.0000.00817.47
8.1.40.0000.00817.41
8.1.30.0040.00417.59
8.1.20.0050.00517.61
8.1.10.0000.00817.56
8.1.00.0040.00417.36
8.0.300.0080.00419.92
8.0.290.0060.00316.75
8.0.280.0030.00318.41
8.0.270.0030.00316.88
8.0.260.0040.00416.82
8.0.250.0070.00016.86
8.0.240.0000.00816.83
8.0.230.0070.00016.96
8.0.220.0030.00316.91
8.0.210.0070.00016.89
8.0.200.0070.00016.96
8.0.190.0000.00916.92
8.0.180.0040.00416.91
8.0.170.0040.00416.95
8.0.160.0040.00416.93
8.0.150.0060.00316.84
8.0.140.0030.00316.86
8.0.130.0000.00513.32
8.0.120.0040.00416.75
8.0.110.0040.00416.67
8.0.100.0000.00716.77
8.0.90.0050.00216.91
8.0.80.0030.01216.85
8.0.70.0000.00716.85
8.0.60.0000.00716.71
8.0.50.0000.00716.88
8.0.30.0090.00917.21
8.0.20.0110.00717.40
8.0.10.0040.00417.02
8.0.00.0100.00716.80
7.4.330.0050.00015.55
7.4.320.0030.00316.50
7.4.300.0070.00016.50
7.4.290.0070.00016.52
7.4.280.0040.00416.42
7.4.270.0030.00316.53
7.4.260.0030.00616.63
7.4.250.0000.00716.44
7.4.240.0070.00016.53
7.4.230.0040.00416.48
7.4.220.0060.01716.54
7.4.210.0120.00316.55
7.4.200.0050.00216.62
7.4.160.0080.00816.29
7.4.150.0060.01217.40
7.4.140.0090.01217.86
7.4.130.0080.01016.50
7.4.120.0070.01116.54
7.4.110.0070.01316.36
7.4.100.0060.01316.42
7.4.90.0090.01316.75
7.4.80.0130.00419.39
7.4.70.0030.01416.57
7.4.60.0040.01216.34
7.4.50.0070.01016.48
7.4.40.0070.01016.60
7.4.30.0060.01416.53
7.4.00.0060.01314.93
7.3.330.0000.00513.38
7.3.320.0050.00013.32
7.3.310.0000.00716.39
7.3.300.0000.00716.35
7.3.290.0030.00516.39
7.3.280.0070.01116.33
7.3.270.0140.00417.40
7.3.260.0090.00916.61
7.3.250.0100.00716.44
7.3.240.0080.01416.35
7.3.230.0060.01316.48
7.3.210.0100.00716.43
7.3.200.0070.01016.49
7.3.190.0000.01716.33
7.3.180.0040.01216.29
7.3.170.0100.00616.63
7.3.160.0100.01016.64
7.3.120.0070.00714.67
7.3.110.0070.01014.86
7.3.100.0140.00014.62
7.3.90.0060.00614.94
7.3.80.0030.01015.08
7.3.70.0110.00614.70
7.3.60.0040.01114.72
7.3.50.0080.00614.87
7.3.40.0080.00814.75
7.3.30.0110.01314.62
7.3.20.0070.01014.61
7.3.10.0090.00714.77
7.3.00.0600.01014.79
7.2.330.0000.01716.69
7.2.320.0060.01116.70
7.2.310.0090.00916.42
7.2.300.0100.01016.64
7.2.290.0160.00616.45
7.2.250.0030.01215.14
7.2.240.0140.00015.04
7.2.230.0100.00314.91
7.2.220.0040.01014.92
7.2.210.0090.00614.95
7.2.200.0120.00614.90
7.2.190.0050.01015.04
7.2.180.0080.00614.91
7.2.170.0070.00714.89
7.2.160.0090.00814.76
7.2.150.0120.00914.92
7.2.140.0140.00614.87
7.2.130.0190.00814.97
7.2.120.0180.00214.95
7.2.110.0100.00914.92
7.2.100.0150.01114.69
7.2.90.0090.01014.77
7.2.80.0120.01014.97
7.2.70.0120.00714.78
7.2.60.0110.00915.47
7.2.50.0130.00414.75
7.2.40.0170.00514.84
7.2.30.0150.00814.87
7.2.20.0350.00614.96
7.2.10.0120.00715.07
7.2.00.0100.01215.02
7.1.330.0110.00414.02
7.1.320.0100.00313.86
7.1.310.0090.00613.79
7.1.300.0110.00713.88
7.1.290.0110.00413.94
7.1.280.0060.01013.99
7.1.270.0070.00813.87
7.1.260.0130.00813.84
7.1.250.0250.00713.66
7.1.240.0180.00513.74
7.1.230.0140.01313.71
7.1.220.0090.01113.79
7.1.210.0190.00213.77
7.1.200.0060.01214.42
7.1.190.0130.00813.93
7.1.180.0160.00913.88
7.1.170.0220.00713.88
7.1.160.0160.00513.92
7.1.150.0110.01113.97
7.1.140.0160.01313.92
7.1.130.0120.01013.93
7.1.120.0190.00613.82
7.1.110.0190.00713.81
7.1.100.0160.01013.99
7.1.90.0160.00813.65
7.1.80.0150.00413.60
7.1.70.0110.00714.76
7.1.60.0100.00614.79
7.1.50.0110.01113.66
7.1.40.0160.00513.71
7.1.30.0150.00713.68
7.1.20.0950.03726.63
7.1.10.0120.02716.67
7.1.00.0580.03016.67
7.0.330.0130.01213.28
7.0.320.0160.00413.59
7.0.310.0160.00413.54
7.0.300.0190.00813.44
7.0.290.0180.00613.43
7.0.280.0180.00213.34
7.0.270.0210.00613.52
7.0.260.0180.00713.59
7.0.250.0190.00813.50
7.0.240.0180.00713.38
7.0.230.0180.00313.49
7.0.220.0110.01413.49
7.0.210.0130.00913.66
7.0.200.0110.01014.55
7.0.190.0210.00213.63
7.0.180.0170.01413.67
7.0.170.0150.01013.71
7.0.160.0200.02215.78
7.0.150.0130.03016.33
7.0.140.0170.03116.35
7.0.130.0100.02716.28
7.0.120.0170.02216.36
7.0.110.0060.02916.21
7.0.100.0120.02616.27
7.0.90.0210.02416.36
7.0.80.0160.02116.40
7.0.70.0140.02416.36
7.0.60.0080.02716.41
7.0.50.0140.02216.49
7.0.40.0140.02516.46
7.0.30.0140.02216.44
7.0.20.0170.02816.45
7.0.10.0170.01916.50
7.0.00.0160.02316.45
5.6.400.0160.00614.38
5.6.390.0140.00914.38
5.6.380.0130.00614.36

preferences:
41.26 ms | 403 KiB | 5 Q