3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ ['spubid' => 'A00502','sfirst'=>'J.','smi'=>'A.','slast'=>'Doe'], ['spubid' => 'A00502','sfirst'=>'J.','smi'=>'F.','slast'=>'Kennedy'], ['spubid' => 'A00502','sfirst'=>'B.','smi'=>'F.','slast'=>'James'], ['spubid' => 'BXXXXX','sfirst'=>'B.','smi'=>'F.','slast'=>'James'], ['spubid' => 'A00502','sfirst'=>'S.','smi'=>'M.','slast'=>'Williamson'], ]; $result = []; foreach ($array as $row) { $id = $row['spubid']; if (!isset($ref[$id])) { $ref[$id] = $row; $counter[$id] = 0; $result[] = &$ref[$id]; } else { unset($row['spubid']); ++$counter[$id]; foreach ($row as $k => $v) { $ref[$id][$k . $counter[$id]] = $v; } } } var_export($result);

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.20.0120.00617.88
8.5.10.0140.00616.70
8.5.00.0180.00620.07
8.4.170.0090.01121.88
8.4.160.0120.01123.87
8.4.150.0030.00014.05
8.4.140.0130.01017.82
8.4.130.0160.00518.90
8.4.120.0120.00423.86
8.4.110.0060.00422.26
8.4.100.0120.00917.81
8.4.90.0050.00518.64
8.4.80.0070.00122.35
8.4.70.0130.00717.96
8.4.60.0130.00718.86
8.4.50.0160.00420.43
8.4.40.0100.01017.63
8.4.30.0040.01218.90
8.4.20.0060.00919.85
8.4.10.0130.00619.59
8.3.290.0140.00620.75
8.3.280.0090.01118.74
8.3.270.0140.00916.66
8.3.260.0140.00716.70
8.3.250.0100.01018.85
8.3.240.0090.01017.43
8.3.230.0070.00216.57
8.3.220.0100.00917.04
8.3.210.0080.00316.83
8.3.200.0070.00316.87
8.3.190.0020.00617.31
8.3.180.0130.00616.78
8.3.170.0110.00719.09
8.3.160.0120.00618.27
8.3.150.0140.00318.34
8.3.140.0120.00317.31
8.3.130.0060.00318.57
8.3.120.0040.00418.99
8.3.110.0080.00020.94
8.3.100.0070.01024.06
8.3.90.0030.00526.77
8.3.80.0060.00318.28
8.3.70.0140.00718.55
8.3.60.0120.00318.31
8.3.50.0160.00316.68
8.3.40.0060.00920.00
8.3.30.0070.00721.86
8.3.20.0000.00824.18
8.3.10.0050.00324.66
8.3.00.0140.01026.35
8.2.300.0140.00917.91
8.2.290.0060.00422.12
8.2.280.0100.00818.74
8.2.270.0030.01517.17
8.2.260.0100.01016.39
8.2.250.0080.00018.36
8.2.240.0150.00019.11
8.2.230.0000.00822.58
8.2.220.0100.00637.54
8.2.210.0080.00026.77
8.2.200.0040.00416.63
8.2.190.0120.00316.58
8.2.180.0160.00018.41
8.2.170.0040.01118.91
8.2.160.0030.01022.96
8.2.150.0050.00325.66
8.2.140.0040.00424.66
8.2.130.0090.00926.35
8.2.120.0000.00826.35
8.2.110.0050.00326.35
8.2.100.0000.00826.35
8.2.90.0000.00826.35
8.2.80.0040.00426.35
8.2.70.0080.00026.35
8.2.60.0000.00826.35
8.2.50.0040.00426.35
8.2.40.0080.00026.35
8.2.30.0050.00326.35
8.2.20.0090.00026.35
8.2.10.0040.00426.35
8.2.00.0060.00326.35
8.1.340.0110.00917.54
8.1.330.0100.00723.66
8.1.320.0110.00916.09
8.1.310.0170.00318.14
8.1.300.0060.00316.34
8.1.290.0060.00318.88
8.1.280.0140.00025.92
8.1.270.0000.00724.66
8.1.260.0030.00526.35
8.1.250.0040.00426.35
8.1.240.0090.00026.35
8.1.230.0030.00626.35
8.1.220.0000.00826.35
8.1.210.0080.00026.35
8.1.200.0000.00826.35
8.1.190.0000.00826.35
8.1.180.0050.00326.35
8.1.170.0080.00026.35
8.1.160.0050.00326.35
8.1.150.0000.00826.35
8.1.140.0000.00826.35
8.1.130.0040.00426.35
8.1.120.0030.00626.35
8.1.110.0050.00326.35
8.1.100.0000.00926.35
8.1.90.0030.00526.35
8.1.80.0080.00026.35
8.1.70.0030.00526.35
8.1.60.0040.00426.35
8.1.50.0050.00326.35
8.1.40.0030.00626.35
8.1.30.0070.00326.35
8.1.20.0000.00826.35
8.1.10.0040.00426.35
8.1.00.0080.00026.35

preferences:
32.33 ms | 403 KiB | 5 Q