PHP is_infinite() Function

❮ PHP Math Reference

Example

Check whether a value is infinite or not:

<?php
echo is_infinite(2) . "<br>";
echo is_infinite(log(0)) . "<br>";
echo is_infinite(2000);
?>
Try it Yourself »

Definition and Usage

The is_infinite() function checks whether a value is infinite or not.

This function returns true (1) if the specified value is an infinite number, otherwise it returns false/nothing.

The value is infinite if it is outside the allowed range for a PHP float on this platform.


Syntax

is_infinite(value);

Parameter Values

Parameter Description
value Required. Specifies the value to check

Technical Details

Return Value: TRUE if value is an infinite number, FALSE otherwise
Return Type: Boolean
PHP Version: 4.2+

❮ PHP Math Reference
Copyright 1999-2023 by Refsnes Data. All Rights Reserved.