count() emitting an E_WARNING

As we discussed, there are multiple ways to achieve the original functionality of count() and not emit an E_WARNING. In PHP 7.3 a new function was added is_countable, specifically to address the E_WARNING issue and the prevalence of applications adopting is_array($var) || $var instanceof \Countable in their code. In PHP 7.2, a Warning was added … Read more