3v4l.org

run code in 300+ PHP versions simultaneously
<?php $items = array( array ( 'title'=>"a", 'filename'=>"1.jpg" ), array ( 'title'=>"a", 'filename'=>"2.jpg" ), array ( 'title'=>"b", 'filename'=>"1.jpg" ), array ( 'title'=>"b", 'filename'=>"2.jpg" ) ); // I have used below to create an stdClass object array, don't use this line in your code $items = json_decode(json_encode($items)); $finalArray = []; foreach($items as $item){ $finalArray[$item->title]['filename'][] = $item->filename; } foreach($finalArray as $key=>$value){ echo $key.PHP_EOL; foreach($value['filename'] as $val){ echo $val.PHP_EOL; } echo PHP_EOL; echo PHP_EOL; }

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.0120.00318.68
8.3.50.0080.01118.28
8.3.40.0080.00818.63
8.3.30.0110.00318.89
8.3.20.0000.00820.90
8.3.10.0040.00421.74
8.3.00.0060.00323.53
8.2.180.0180.00416.38
8.2.170.0120.00322.96
8.2.160.0120.00621.01
8.2.150.0050.00324.18
8.2.140.0040.00424.66
8.2.130.0080.00026.16
8.2.120.0060.00326.16
8.2.110.0070.00321.07
8.2.100.0070.00418.03
8.2.90.0000.00917.97
8.2.80.0040.00418.22
8.2.70.0040.00417.50
8.2.60.0040.00417.63
8.2.50.0060.00317.55
8.2.40.0000.00918.35
8.2.30.0040.00418.24
8.2.20.0040.00418.19
8.2.10.0040.00419.34
8.2.00.0000.00719.25
8.1.280.0140.00025.92
8.1.270.0130.00623.99
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0030.00622.14
8.1.230.0110.00020.94
8.1.220.0040.00417.75
8.1.210.0060.00318.77
8.1.200.0060.00317.35
8.1.190.0050.00317.23
8.1.180.0000.00822.07
8.1.170.0020.00518.80
8.1.160.0000.00919.00
8.1.150.0070.00018.89
8.1.140.0090.00020.59
8.1.130.0000.00717.46
8.1.120.0030.00317.48
8.1.110.0000.00817.50
8.1.100.0030.00517.53
8.1.90.0000.01017.52
8.1.80.0000.00717.50
8.1.70.0070.00017.51
8.1.60.0050.00317.58
8.1.50.0050.00317.54
8.1.40.0000.00817.50
8.1.30.0040.00417.54
8.1.20.0000.01017.64
8.1.10.0030.00617.50
8.1.00.0040.00417.53
8.0.300.0000.00719.89
8.0.290.0040.00416.63
8.0.280.0040.00420.28
8.0.270.0030.00317.26
8.0.260.0030.00316.82
8.0.250.0040.00417.01
8.0.240.0030.00316.98
8.0.230.0040.00416.98
8.0.220.0000.00716.80
8.0.210.0030.00316.77
8.0.200.0040.00416.90
8.0.190.0040.00416.99
8.0.180.0030.00616.82
8.0.170.0080.00016.93
8.0.160.0000.00716.97
8.0.150.0040.00416.81
8.0.140.0040.00416.89
8.0.130.0030.00313.36
8.0.120.0000.00816.85
8.0.110.0000.00716.98
8.0.100.0000.00716.96
8.0.90.0040.00416.86
8.0.80.0150.00616.79
8.0.70.0040.00416.77
8.0.60.0000.00816.84
8.0.50.0000.00716.93
8.0.30.0110.00717.14
8.0.20.0120.00617.03
8.0.10.0000.00817.09
8.0.00.0150.00716.77
7.4.330.0020.00215.55
7.4.320.0030.00316.57
7.4.300.0000.00716.59
7.4.290.0040.00416.41
7.4.280.0030.00516.61
7.4.270.0030.00316.66
7.4.260.0000.00716.50
7.4.250.0080.00016.40
7.4.240.0040.00416.57
7.4.230.0040.00416.54
7.4.220.0000.00716.61
7.4.210.0080.01016.59
7.4.200.0030.00316.41
7.4.160.0090.01016.44
7.4.130.0140.00416.43
7.4.120.0150.00616.48
7.4.110.0030.01316.63
7.4.100.0030.01416.49
7.4.90.0100.00716.41
7.4.80.0100.00719.39
7.4.70.0060.01216.51
7.4.60.0060.00916.27
7.4.50.0030.01016.54
7.4.40.0090.00616.37
7.4.00.0060.01015.21
7.3.330.0060.00013.25
7.3.320.0030.00313.18
7.3.310.0040.00416.32
7.3.300.0030.00316.33
7.3.290.0030.00316.33
7.3.280.0140.00616.30
7.3.260.0100.00916.38
7.3.240.0080.00916.44
7.3.230.0070.01116.37
7.3.210.0130.00316.37
7.3.200.0120.00916.37
7.3.190.0040.01116.67
7.3.180.0030.01716.48
7.3.170.0060.01216.31
7.3.160.0030.01316.33
7.3.60.0070.01414.89
7.3.50.0000.01414.87
7.3.40.0140.00314.41
7.3.30.0110.01114.96
7.3.20.0070.00716.64
7.3.10.0140.00016.65
7.3.00.0080.01216.71
7.2.330.0080.00816.72
7.2.320.0110.01116.77
7.2.310.0070.01016.54
7.2.300.0080.00816.46
7.2.290.0090.01216.61
7.2.190.0080.00814.91
7.2.180.0090.00515.03
7.2.170.0110.00415.14
7.2.160.0040.01315.00
7.2.150.0060.00916.98
7.2.140.0040.01217.05
7.2.130.0040.01116.70
7.2.120.0120.00616.98
7.2.110.0090.00916.70
7.2.100.0120.00317.03
7.2.90.0120.00616.88
7.2.80.0040.01117.06
7.2.70.0040.01716.83
7.2.60.0060.01016.80
7.2.50.0160.00316.83
7.2.40.0060.01116.96
7.2.30.0100.00716.84
7.2.20.0080.01316.89
7.2.10.0030.01116.90
7.2.00.0100.01016.60
7.1.300.0040.01815.84
7.1.290.0110.01115.60
7.1.280.0030.01015.91
7.1.270.0070.00715.81
7.1.260.0090.00515.62
7.1.250.0050.00915.66

preferences:
33.3 ms | 401 KiB | 5 Q