Note: if is_countable() return true is does not guarantee that the it can be calculated recursively and correctly:
<?php
$iterator = new ArrayIterator(['one', 'two', new ArrayIterator(['three', 'four'])]);
var_dump(is_countable($iterator), count($iterator, COUNT_RECURSIVE));
// return TRUE and 3!
?>