3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php echo count(array()); echo count(false); echo count(null); unset($ducks); echo count($ducks); $ducks = 'awesome'; echo count($ducks);
Output for 7.2.0 - 7.3.0rc4
0 Warning: count(): Parameter must be an array or an object that implements Countable in /in/F2vFH on line 4 1 Warning: count(): Parameter must be an array or an object that implements Countable in /in/F2vFH on line 5 0 Notice: Undefined variable: ducks in /in/F2vFH on line 8 Warning: count(): Parameter must be an array or an object that implements Countable in /in/F2vFH on line 8 0 Warning: count(): Parameter must be an array or an object that implements Countable in /in/F2vFH on line 11 1
Output for 5.0.4 - 7.1.20
010 Notice: Undefined variable: ducks in /in/F2vFH on line 8 01
Output for 4.3.0 - 5.0.3
010 Notice: Undefined variable: ducks in /in/F2vFH on line 8 01