WordPress at a glance
function is not described

is_countable() WP 4.9.6

Polyfill for is_countable() function added in PHP 7.3.

Verify that the content of a variable is an array or an object implementing the Countable interface.

No Hooks.


true/false. True if $var is countable, false otherwise.


is_countable( $var );
$var(mixed) (required)
The value to check.

Code of is countable: wp-includes/compat.php VER 5.1.1

function is_countable( $var ) {
	return ( is_array( $var )
		|| $var instanceof Countable
		|| $var instanceof SimpleXMLElement
		|| $var instanceof ResourceBundle