Index: src/wp-includes/compat.php
===================================================================
--- src/wp-includes/compat.php	(revision 42992)
+++ src/wp-includes/compat.php	(working copy)
@@ -505,3 +505,22 @@
 if ( ! function_exists( 'spl_autoload_register' ) ) {
 	require_once ABSPATH . WPINC . '/spl-autoload-compat.php';
 }
+
+if ( ! function_exists( 'is_iterable' ) ) {
+	/**
+	 * Polyfill for is_iterable function added in PHP 7.1.
+	 *
+	 * Verify that the content of a variable is a non-empty array or an object
+	 * implementing the Traversable interface.
+	 *
+	 * @since 4.9.6
+	 *
+	 * @param mixed $var Variable to check.
+	 *
+	 * @return bool Whether the provided variable is iterable.
+	 */
+	function is_iterable( $var ) {
+		return ( is_array( $var ) && ! empty( $var ) )
+			|| $var instanceof Traversable;
+	}
+}
Index: tests/phpunit/tests/compat.php
===================================================================
--- tests/phpunit/tests/compat.php	(revision 42992)
+++ tests/phpunit/tests/compat.php	(working copy)
@@ -186,6 +186,29 @@
 		$this->assertEquals( '["foo"]', $json->encodeUnsafe( array( 'foo' ) ) );
 		$this->assertEquals( array( 'foo' ), $json->decode( '["foo"]' ) );
 	}
+
+	/**
+	 * @ticket 43619
+	 * @dataProvider iterable_variable_test_data
+	 * @param mixed $variable
+	 * @param bool $expected
+	 */
+	function test_is_iterable( $variable, $expected ) {
+		$this->assertEquals( is_iterable( $variable ), $expected );
+	}
+
+	/**
+	 * @ticket 43619
+	 */
+	function iterable_variable_test_data() {
+		return array(
+			array( array( 1, 2, 3 ), true ),
+			array( new \ArrayIterator( array( 1, 2, 3 ) ), true ),
+			array( 1, false ),
+			array( 3.14, false ),
+			array( new stdClass(), false ),
+		);
+	}
 }
 
 /* used in test_mb_substr_phpcore */
