3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arrays=Array ( "21" => Array ( "0" => 3.5, "65" => Array ( "0" => 44.125 ), "150" => Array ( "0" => 15.25 ), "151" => Array ( "0" => 17.333333333333 ) ), "23" => Array ( "0" => 0, "166" => Array ( "0" => 26 ), "172" => Array ( "0" =>0 ), "182" => Array ( "0" => 20.333333333333 ), "183" => Array ( "0" => 24.125 ) ) ); $count1 = 0; $sum=0; $count2 = 0; $sum2=0; function isarr($array,$key7,$sum1,$count) { $array2 = array_values($array); $size = sizeof($array2); foreach($array as $key1 => $value1) { if(is_array($value1)) { isarr($value1,$key7,$sum1,$count); } else { if($key1 == "0") { $sum1 = $sum1 + $value1;$count++; } } } if(!is_array($array)) $arrays[$key7][0] = $sum1 / $count; echo $sum1."\n"; } foreach ($arrays as $key3 => $value3) { isarr($value3,$key3,0,0); } //$array[21][0] = ($sum/$count1); //$array[23][0] = ($sum2/$count2); //echo $catCount = count(preg_grep("/^0+$/", array_keys(get_object_vars($array)))); print_r($arrays);
Output for git.master, git.master_jit, rfc.property-hooks
47.625 18.75 20.833333333333 3.5 26 0 20.333333333333 24.125 0 Array ( [21] => Array ( [0] => 3.5 [65] => Array ( [0] => 44.125 ) [150] => Array ( [0] => 15.25 ) [151] => Array ( [0] => 17.333333333333 ) ) [23] => Array ( [0] => 0 [166] => Array ( [0] => 26 ) [172] => Array ( [0] => 0 ) [182] => Array ( [0] => 20.333333333333 ) [183] => Array ( [0] => 24.125 ) ) )

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:
39.84 ms | 403 KiB | 8 Q