is_countable()

最后更新于:2021-11-27 08:40:36

is_countable( mixed$var)

Polyfill for is_countable() function added in PHP 7.3.

参数

$var

(mixed) (Required) The value to check.

响应

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

源文件

文件: gc-includes/compat.php

	function is_countable( $var ) {
		return ( is_array( $var )
			|| $var instanceof Countable
			|| $var instanceof SimpleXMLElement
			|| $var instanceof ResourceBundle
		);
	}