is_integer()
is_integer() — Alias of is_int().
Built-in function of PHP 8.5. The manual lists it as available in PHP 4, PHP 5, PHP 7, PHP 8. This page is the reference card: signature, parameters and return value, plus the changelog and the example the manual provides.
is_integer() is an alias of is_int(): same parameters, same return value.
Signature
is_integer(mixed $value): bool
Parameters
| Parameter | Type | What it takes |
|---|---|---|
| $value | mixed | The variable being evaluated. |
Return value
Returns true if value is an int, false otherwise.
Example
A runnable snippet:
$values = array(23, "23", 23.5, "23.5", null, true, false); foreach ($values as $value) { echo "is_int("; var_export($value); echo ") = "; var_dump(is_int($value)); }
Output:
is_int(23) = bool(true) is_int('23') = bool(false) is_int(23.5) = bool(false) is_int('23.5') = bool(false) is_int(NULL) = bool(false) is_int(true) = bool(false) is_int(false) = bool(false)
All PHP 8.5 built-in functions
Reference card built from the PHP manual page is_integer() (PHP documentation, CC BY 3.0). The page is generated from the manual, so the wording of the parameter and return value text follows php.net.