wpseek.com
A WordPress-centric search engine for devs and theme authors



is_iterable › WordPress Function

Since4.9.6
Deprecatedn/a
is_iterable ( $value )
Parameters:
  • (mixed) $value The value to check.
    Required: Yes
Returns:
  • (bool) True if `$value` is iterable, false otherwise.
Defined at:
Codex:

Polyfill for is_iterable() function added in PHP 7.1.

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


Source

function is_iterable( $value ) {
		return ( is_array( $value ) || $value instanceof Traversable );
	}
}