3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php 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" =>"" ), "182" => Array ( "0" => 20.333333333333 ), "183" => Array ( "0" => 24.125 ) ) ); $count1 = 0; $count2 = 0; foreach ($array as $key3 => $value3) { if($key == "21") { foreach ($value3 as $key => $value) { if (strpos($key, '0') === 0) { $count1++; } if(is_array($value)) { foreach($value as $key2=>$value2) { if(strpos($key2,'0') === 0) { $count1++ ; } } } } } if($key == "23") { foreach ($value3 as $key => $value) { if (strpos($key, '0') === 0) { $count2++; } if(is_array($value)) { foreach($value as $key2=>$value2) { if(strpos($key2,'0') === 0) { $count2++; } } } } } }
Output for 5.1.0 - 5.6.28, 7.0.0 - 7.1.0
Notice: Undefined variable: array in /in/Erkvv on line 53 Warning: Invalid argument supplied for foreach() in /in/Erkvv on line 53
Output for hhvm-3.10.0 - 3.12.0
Notice: Undefined variable: array in /in/Erkvv on line 93 Warning: Invalid argument supplied for foreach() in /in/Erkvv on line 93
Output for 4.3.0 - 4.3.10, 4.4.0 - 5.0.5
Warning: Invalid argument supplied for foreach() in /in/Erkvv on line 53
Output for 4.3.11