3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ [ 'url' => 'http://domain1.com', 'domain' => 'domain1.com', 'values' => ['character_length' => 25, 'word_count' => 7] ], [ 'url' => 'http://domain2.com', 'domain' => 'domain2.com', 'values' => ['character_length' => 30, 'word_count' => 7] ] ]; var_export( array_reduce( $array, function($result, $row) { if (!isset($result)) { $result = $row; } else { $result['values']['character_length'] += $row['values']['character_length']; $result['values']['word_count'] += $row['values']['word_count']; } return $result; } ) );
Output for git.master, git.master_jit, rfc.property-hooks
array ( 'url' => 'http://domain1.com', 'domain' => 'domain1.com', 'values' => array ( 'character_length' => 55, 'word_count' => 14, ), )

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:
51.31 ms | 999 KiB | 4 Q