3v4l.org

run code in 300+ PHP versions simultaneously
<?php $testOne = array ( 'Smith'=> 98, 'Johnson' => 67, ); $testTwo = array ( 'Smith'=> 100, 'Johnson' => 85, ); $testThree = array ( 'Smith'=> 78, 'Johnson' => 92, ); $testFour = array ( 'Smith'=> 91, 'Johnson' => 88, ); $total = [$testOne, $testTwo, $testThree, $testFour]; Foreach($total[0] as $name => $val){ $averages[$name] = array_sum(array_column($total, $name))/count($total); } var_dump($averages);
Output for git.master_jit, git.master, rfc.property-hooks
array(2) { ["Smith"]=> float(91.75) ["Johnson"]=> int(83) }

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