Example 1 — Check simple values
See which values count as finite.
<?php
echo var_export(is_finite(5.5), true) . PHP_EOL;
echo var_export(is_finite(0), true) . PHP_EOL;
echo var_export(is_finite(INF), true) . PHP_EOL; How It Works
- 5.5 is a normal number, so is_finite() returns true.
- 0 is also finite, and the int is converted to a float automatically.
- INF is infinity, so the answer is false.
- var_export(..., true) turns the boolean into the text true or false so echo can print it.

