3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = array( array( 'pageviews' => 233, 'pagepath' => 111 ), array( 'pageviews' => 100, 'pagepath' => 111 ), array( 'pageviews' => 300, 'pagepath' => 222 ) ); $grouped = []; foreach($data as $subarr) { if(isset($grouped[((object) $subarr)->pagepath])) { $grouped[((object) $subarr)->pagepath] += ((object) $subarr)->pageviews; continue; } $grouped[((object) $subarr)->pagepath] = ((object) $subarr)->pageviews; } print_r($grouped);
Output for git.master_jit, git.master, rfc.property-hooks
Array ( [111] => 333 [222] => 300 )

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:
206.26 ms | 405 KiB | 5 Q