Comparing NAN¶
PHP does not compare NAN values: it always fails, even if the source is the same.
Depending on the context, NAN becomes the string 'NAN', or the integer 0.
Since PHP 8.1, the engine emits a warning to signal it: this is good, and helps spotting such mistakes.
And, in the end, no one uses NAN anyway.
See Also¶
nan !== nan [Try me]