3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data[] = new stdClass; $data[0]->product_name = '1'; $data[0]->random_value = 'first'; $data[1]->product_name = '2'; $data[1]->random_value = 'second'; $data[2]->product_name = '2'; $data[2]->random_value = 'third'; $data[3]->product_name = '1'; $data[3]->random_value = 'fourth'; $data[4]->product_name = '3'; $data[4]->random_value = 'fifth'; $products = array(); foreach ($data as $data_object) { $products[$data_object->product_name][] = $data_object; } // product names are keys of $products var_dump(array_keys($products)); // products for each key var_dump($products);

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.0100.01117.93
8.4.130.0050.00418.84
8.4.120.0120.00720.77
8.4.110.0130.00918.17
8.4.100.0090.01118.11
8.4.90.0050.00420.56
8.4.80.0040.00418.83
8.4.70.0110.00918.64
8.4.60.0090.01120.41
8.4.50.0110.00318.84
8.4.40.0100.01022.25
8.4.30.0140.00720.26
8.4.20.0070.01317.82
8.4.10.0040.00422.01
8.3.270.0120.00816.47
8.3.260.0160.00416.57
8.3.250.0150.00718.87
8.3.240.0070.00116.98
8.3.230.0080.01116.82
8.3.220.0060.00218.83
8.3.210.0110.00916.79
8.3.200.0070.00216.68
8.3.190.0030.00519.09
8.3.180.0040.00419.14
8.3.170.0100.01019.02
8.3.160.0090.00916.71
8.3.150.0120.00616.72
8.3.140.0080.00016.72
8.3.130.0030.00618.58
8.3.120.0060.00318.90
8.3.110.0060.00320.94
8.3.100.0030.00624.06
8.3.90.0040.00426.77
8.3.80.0040.00816.38
8.3.70.0120.00616.88
8.3.60.0090.00618.30
8.3.50.0120.00320.41
8.3.40.0040.01122.10
8.3.30.0030.01718.76
8.3.20.0040.00424.18
8.3.10.0040.00424.66
8.3.00.0000.00826.16
8.2.290.0110.00816.91
8.2.280.0100.01018.67
8.2.270.0140.00316.54
8.2.260.0060.01017.08
8.2.250.0000.00818.84
8.2.240.0030.00616.72
8.2.230.0040.00422.58
8.2.220.0080.00037.54
8.2.210.0040.00426.77
8.2.200.0000.00916.75
8.2.190.0060.00916.88
8.2.180.0040.01525.92
8.2.170.0110.00419.09
8.2.160.0110.00322.96
8.2.150.0080.00025.66
8.2.140.0040.00424.66
8.2.130.0000.00726.16
8.2.120.0020.00519.66
8.2.110.0000.01020.57
8.2.100.0100.00020.38
8.1.330.0160.00616.26
8.1.320.0120.00820.18
8.1.310.0030.00618.36
8.1.300.0060.00316.10
8.1.290.0060.00330.84
8.1.280.0090.00625.92
8.1.270.0060.00324.01
8.1.260.0070.01026.35
8.1.250.0030.00528.09
8.1.240.0000.01118.48
8.1.230.0000.01118.40
7.4.300.0050.00216.61

preferences:
68.51 ms | 403 KiB | 5 Q