mirror of
https://github.com/WordPress/WordPress.git
synced 2024-11-12 13:44:21 +01:00
General: Introduce a polyfill for is_countable()
function added in PHP 7.3.
Props jrf, ayeshrajans, desrosj. See #43583. Built from https://develop.svn.wordpress.org/trunk@43034 git-svn-id: http://core.svn.wordpress.org/trunk@42863 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
70a214c186
commit
5813ccec07
@ -505,3 +505,21 @@ endif;
|
||||
if ( ! function_exists( 'spl_autoload_register' ) ) {
|
||||
require_once ABSPATH . WPINC . '/spl-autoload-compat.php';
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'is_countable' ) ) {
|
||||
/**
|
||||
* Polyfill for is_countable() function added in PHP 7.3.
|
||||
*
|
||||
* Verify that the content of a variable is an array or an object
|
||||
* implementing Countable.
|
||||
*
|
||||
* @since 4.9.6
|
||||
*
|
||||
* @param mixed $var The value to check.
|
||||
*
|
||||
* @return bool True if `$var` is countable, false otherwise.
|
||||
*/
|
||||
function is_countable( $var ) {
|
||||
return ( is_array( $var ) || $var instanceof Countable );
|
||||
}
|
||||
}
|
||||
|
@ -4,7 +4,7 @@
|
||||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '5.0-alpha-43032';
|
||||
$wp_version = '5.0-alpha-43034';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
Loading…
Reference in New Issue
Block a user