3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $iterator = new EmptyIterator(); var_dump(array( 'count' => count($iterator), 'empty' => empty($iterator), 'is countable' => $iterator instanceof Countable, ));
Output for 7.2.0
Warning: count(): Parameter must be an array or an object that implements Countable in /in/vIfLn on line 5 array(3) { ["count"]=> int(1) ["empty"]=> bool(false) ["is countable"]=> bool(false) }
Output for 5.3.19 - 7.1.10
array(3) { ["count"]=> int(1) ["empty"]=> bool(false) ["is countable"]=> bool(false) }