3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $var = ''; $res = count($var); var_dump($res); if (count($var) > 1) { echo "yeah"; }else { echo "no"; } $var = null; $res = count($var); var_dump($res); if (count($var) > 1) { echo "yeah"; }else { echo "no"; }
based on QfUer
Output for 7.2.0
Warning: count(): Parameter must be an array or an object that implements Countable in /in/HoiD0 on line 5 int(1) Warning: count(): Parameter must be an array or an object that implements Countable in /in/HoiD0 on line 8 no Warning: count(): Parameter must be an array or an object that implements Countable in /in/HoiD0 on line 16 int(0) Warning: count(): Parameter must be an array or an object that implements Countable in /in/HoiD0 on line 19 no
Output for 5.3.19 - 7.1.10
int(1) noint(0) no