3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $array = array( 0 => null, 1 => null, 2 => null ); if (count(array_keys($array, null, true)) != count($array)) { echo 'true'; } else { echo 'false'; } /* if(array_filter($array)) { echo "true\n"; } else echo "false\n"; $array[1] = "test"; if (array_filter($array)) { echo "true\n"; } else echo "false\n"; */
Output for 5.0.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
false
Output for 4.3.0 - 4.4.9
Warning: Wrong parameter count for array_keys() in /in/4PXXD on line 9 true