3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $array = array( 0 => null, 1 => null, 2 => null ); if (count(array_keys($users, null, true)) != count($users)) { echo 'true'; } /* 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.3.0 - 5.6.28, 7.0.0 - 7.1.0
Notice: Undefined variable: users in /in/0QilR on line 9 Warning: array_keys() expects parameter 1 to be array, null given in /in/0QilR on line 9 Notice: Undefined variable: users in /in/0QilR on line 9
Output for hhvm-3.10.0 - 3.12.0
Notice: Undefined variable: users in /in/0QilR on line 9 Warning: array_keys() expects parameter 1 to be an array or collection in /in/0QilR on line 9 Notice: Undefined variable: users in /in/0QilR on line 9
Output for 5.0.4 - 5.2.17
Notice: Undefined variable: users in /in/0QilR on line 9 Warning: array_keys(): The first argument should be an array in /in/0QilR on line 9 Notice: Undefined variable: users in /in/0QilR on line 9
Output for 5.0.0 - 5.0.3
Notice: Undefined variable: users in /in/0QilR on line 9 Warning: array_keys(): The first argument should be an array in /in/0QilR on line 9 Notice: Undefined variable: users in /in/0QilR on line 9
Output for 4.3.0 - 4.4.9
Notice: Undefined variable: users in /in/0QilR on line 9 Warning: Wrong parameter count for array_keys() in /in/0QilR on line 9 Notice: Undefined variable: users in /in/0QilR on line 9