Is there something that's larger than any numbers in PHP?
问题 I need to simulate a ∞ in PHP. So that min(∞,$number) is always $number . 回答1: I suppose that, for integers, you could use PHP_INT_MAX , the following code : var_dump(PHP_INT_MAX); Gives this output, on my machine : int 2147483647 But you have to be careful ; see Integer overflow (quoting) : If PHP encounters a number beyond the bounds of the integer type, it will be interpreted as a float instead. Also, an operation which results in a number beyond the bounds of the integer type will return