PHP is_infinite() Function – Determine if a Value Is Infinite
The article explains PHP’s is_infinite() function, describing its purpose of detecting infinite floating‑point values, detailing its single parameter, return values, and providing example code that demonstrates true and false outcomes, with the expected output shown.
The is_infinite() function in PHP checks whether a given floating‑point value is infinite (positive or negative). If the value exceeds the platform’s floating‑point range, such as the result of log(0), the function returns TRUE; otherwise it returns FALSE.
Parameter: val – The value to be examined.
Return value: TRUE if val is infinite. FALSE otherwise.
Example:
<?php
echo is_infinite(2); // false, outputs 0
echo is_infinite(log(0)); // true, outputs 1
echo is_infinite(2000); // false, outputs 0
?>Output:
1Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Laravel Tech Community
Specializing in Laravel development, we continuously publish fresh content and grow alongside the elegant, stable Laravel framework.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
