3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ [ "a" => 0.333, "b" => 0.730, "c" => 0.393 ], [ "a" => 0.323, "b" => 0.454, "c" => 0.987 ], [ "a" => 0.753, "b" => 0.983, "c" => 0.123 ] ]; var_export( array_reduce( array_keys($array[0] ?? []), fn($result, $k) => $result + [$k => array_sum($c = array_column($array, $k)) / count($c)], [] ) );
Output for git.master, git.master_jit, rfc.property-hooks
array ( 'a' => 0.4696666666666667, 'b' => 0.7223333333333333, 'c' => 0.501, )

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