PHP is_infinite()

ElMurimi's avatar
Published Jul 20, 2023
Contribute to Docs

The is_infinite() function evaluates whether the value is infinite or not and returns a boolean value.

  • Looking for an introduction to the theory behind programming? Master Python while learning data structures, algorithms, and more!
    • Includes 6 Courses
    • With Professional Certification
    • Beginner Friendly.
      75 hours

Syntax

$result = is_infinite(value);

Returns 1 if value is infinite, else returns false.

Example

The example below demonstrates the use of the is_infinite() function to check whether a number is infinite or not.

<?php
$value = log(0);
$result = is_infinite($value);
echo $result;
?>

This example results in the following output:

1

All contributors

Contribute to Docs

Learn PHP on Codecademy

  • Looking for an introduction to the theory behind programming? Master Python while learning data structures, algorithms, and more!
    • Includes 6 Courses
    • With Professional Certification
    • Beginner Friendly.
      75 hours