is_infinite() checks whether a floating-point result represents positive or negative infinity.
$value = INF;
var_dump(is_infinite($value)); // bool(true)
This is the recommended starting pattern. The detailed examples below are retained and modernized for additional variations and explanation.
<?Php
echo is_infinite(2);
echo "<br>";
echo is_infinite(5/10);
echo "<br>";
echo is_infinite(log(0)); Output 1
?>
Syntax
bool is_infinite ( float $input )
| Parameter | DESCRIPTION |
|---|---|
$input | Required : Number to check. |
Author & Instructor at plus2net
I write and maintain practical tutorials on Python, PHP, SQL, JavaScript, HTML, jQuery, and web development at plus2net. The tutorials focus on clear explanations, working examples, and code that readers can test and adapt while learning.