In Perl you can use
$INF = 9**9E9;
which is larger than any value you can store in IEEE floating point numbers. And that really works as intended: any non-infinite number will be smaller than $INF
:
$N < $INF
is true for any "normal" number $N
.
Maybe you use it in PHP too?