3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php var_dump(count(null)); var_dump(count(0)); var_dump(count('zero')); var_dump(count(5));
Output for 7.2.0
Warning: count(): Parameter must be an array or an object that implements Countable in /in/ZWDIF on line 3 int(0) Warning: count(): Parameter must be an array or an object that implements Countable in /in/ZWDIF on line 4 int(1) Warning: count(): Parameter must be an array or an object that implements Countable in /in/ZWDIF on line 5 int(1) Warning: count(): Parameter must be an array or an object that implements Countable in /in/ZWDIF on line 6 int(1)
Output for 4.3.0 - 7.1.10
int(0) int(1) int(1) int(1)