3v4l.org

run code in 300+ PHP versions simultaneously
<?php $collection = array( Array ( 'one' => 10, 'two' => 20, 'three' => 50, 'four' => 80, 'five' => 100 ), Array ( 'three' => 20, 'five' => 20, 'six' => 100, 'seven' => 10 ), Array ( 'one' => 30, 'three' => 30, 'five' => 10, 'eight' => 10 )); Foreach($collection[0] as $key => $val){ $array = array_column($collection, $key); If(count($array) == count($collection)){ $avg[$key] = array_sum($array)/count($array); } } Var_dump($avg);
Output for git.master, git.master_jit, rfc.property-hooks
array(2) { ["three"]=> float(33.333333333333336) ["five"]=> float(43.333333333333336) }

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