Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

INF

Infinite is a PHP constant, called INF. It is also possible to generate such a value, with calls to math functions such as log(0) or 1e308 * 2.

While the infinite is a float, it is possible to test a number with is_infinite().

<?php

$infinite = 1e308 * 2;

var_dump(is_infinite($infinite)); // true 

var_dump(INF === $infinite);      // true 

echo str_repeat('1', 1000) + 0;  // INF

?>

Documentation

See Also