(PHP 4 >= 4.2.0, PHP 5, PHP 7, PHP 8)
is_infinite — Checks whether a float is infinite
numThe float to check
Example #1 is_infinite() example
<?php $inf = 1e308 * 2; var_dump($inf, is_infinite($inf)); $negative_inf = -$inf; var_dump($negative_inf, is_infinite($negative_inf)); ?>
The above example will output:
float(INF) bool(true) float(-INF) bool(true)
© 1997–2025 The PHP Documentation Group
Licensed under the Creative Commons Attribution License v3.0 or later.
https://www.php.net/manual/en/function.is-infinite.php