3v4l.org

run code in 300+ PHP versions simultaneously
<?php $to_account = [ [ 'account' => 251234567890, 'price' => 83 ], [ 'account' => 251234567890, 'price' => 27 ], [ 'account' => 251234564526, 'price' => 180 ], [ 'account' => 251234567890, 'price' => 40 ] ]; foreach ($to_account as $row) { if (!isset($result[$row['account']])) { $result[$row['account']] = $row; } else { $result[$row['account']]['price'] += $row['price']; } } var_export($result);
Output for git.master, git.master_jit, rfc.property-hooks
array ( 251234567890 => array ( 'account' => 251234567890, 'price' => 150, ), 251234564526 => array ( 'account' => 251234564526, 'price' => 180, ), )

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
163.62 ms | 405 KiB | 5 Q