3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $x = array(); var_dump( count($x) ); $x = false; var_dump( count($x) ); $x = array(1); var_dump( count($x) ); $x = 'abc'; var_dump( count($x) );
Output for 7.2.0 - 7.3.0alpha1
int(0) Warning: count(): Parameter must be an array or an object that implements Countable in /in/VnsPC on line 7 int(1) int(1) Warning: count(): Parameter must be an array or an object that implements Countable in /in/VnsPC on line 13 int(1)
Output for 4.3.0 - 7.1.10
int(0) int(1) int(1) int(1)