3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php echo 'count(false): ',count(false),"\n"; echo 'count(0): ',count(0),"\n"; echo 'count(null): ',count(null),"\n"; echo 'count(array()): ',count(array()),"\n"; echo 'count(false): ',count(array(false)),"\n"; echo 'count(0): ',count(array(0)),"\n"; echo 'count(null): ',count(array(null)),"\n"; echo 'count(array()): ',count(array(array())),"\n";
Output for 7.2.0 - 7.3.0rc4
count(false): Warning: count(): Parameter must be an array or an object that implements Countable in /in/PuK4S on line 2 1 count(0): Warning: count(): Parameter must be an array or an object that implements Countable in /in/PuK4S on line 3 1 count(null): Warning: count(): Parameter must be an array or an object that implements Countable in /in/PuK4S on line 4 0 count(array()): 0 count(false): 1 count(0): 1 count(null): 1 count(array()): 1
Output for 4.3.0 - 7.1.20
count(false): 1 count(0): 1 count(null): 0 count(array()): 0 count(false): 1 count(0): 1 count(null): 1 count(array()): 1