3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ ["Plat" => "hello", "Data" => "01/01/2015", "Term" => "PHP", "Quan" => "1"], ["Plat" => "hello", "Data" => "01/01/2015", "Term" => "PHP", "Quan" => "1"], ["Plat" => "hello", "Data" => "03/01/2015", "Term" => "PHP", "Quan" => "1"], ["Plat" => "hello", "Data" => "03/01/2015", "Term" => "PHP", "Quan" => "1"], ["Plat" => "hello", "Data" => "03/01/2015", "Term" => "PHP", "Quan" => "1"], ["Plat" => "hello", "Data" => "03/01/2015", "Term" => "PHP", "Quan" => "1"], ]; foreach ($array as $row) { if (!isset($result[$row['Data']])) { $result[$row['Data']] = $row; } else { $result[$row['Data']]['Quan'] += $row['Quan']; } } $result = array_values($result); var_export($result);
Output for git.master, git.master_jit, rfc.property-hooks
array ( 0 => array ( 'Plat' => 'hello', 'Data' => '01/01/2015', 'Term' => 'PHP', 'Quan' => 2, ), 1 => array ( 'Plat' => 'hello', 'Data' => '03/01/2015', 'Term' => 'PHP', 'Quan' => 4, ), )

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:
23.54 ms | 406 KiB | 5 Q