Changeset 43036 for trunk/src/wp-includes/compat.php
- Timestamp:
- 04/30/2018 04:14:30 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/compat.php
r43034 r43036 512 512 * 513 513 * Verify that the content of a variable is an array or an object 514 * implementing Countable.514 * implementing the Countable interface. 515 515 * 516 516 * @since 4.9.6 … … 524 524 } 525 525 } 526 527 if ( ! function_exists( 'is_iterable' ) ) { 528 /** 529 * Polyfill for is_iterable() function added in PHP 7.1. 530 * 531 * Verify that the content of a variable is an array or an object 532 * implementing the Traversable interface. 533 * 534 * @since 4.9.6 535 * 536 * @param mixed $var The value to check. 537 * 538 * @return bool True if `$var` is iterable, false otherwise. 539 */ 540 function is_iterable( $var ) { 541 return ( is_array( $var ) || $var instanceof Traversable ); 542 } 543 }
Note: See TracChangeset
for help on using the changeset viewer.