is_iterable( mixed $var )

Polyfill for is_iterable() function added in PHP 7.1.


Description

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


Parameters

$var

(Required) The value to check.


Return

(bool) True if $var is iterable, false otherwise.


Source

File: wp-includes/compat.php

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

Changelog

Changelog
Version Description
WP-4.9.6 Introduced.