7

The IEEE-754 floating point standard says:

Four mutually exclusive relations are possible: less than, equal, greater than, and unordered. The last case arises when at least one operand is NaN. Every NaN shall compare unordered with everything, including itself.

And yet (codepad here):

<?php

echo phpversion() . " " . zend_version() . " " . php_uname() . "n";
// 5.2.5 2.2.0 Linux 2cf38fbc9b9e 3.11.0-15-generic #25-Ubuntu SMP
// Thu Jan 30 17:22:01 UTC 2014 x86_64

NAN < NAN; // true
NAN > NAN; // true
INF < INF; // true
INF > INF; // true

So clearly there is more than one relation between NAN and NAN (and between INF and INF), when there should only be one. In many (most? all?) languages with IEEE-754 floats ‘unordered’ means that NaN < NaN is false, and NaN > NaN is false, and NaN == NaN is false. Does this demonstrate that PHP does not use IEEE-754 floating point numbers?