3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php var_dump(NAN, NAN < NAN, NAN > NAN, NAN > 0.0, NAN < 0.0, NAN == NAN /* the only comparison that seems correct */); echo "\n----\n\n"; var_dump(INF, INF < INF, INF > INF, INF == INF);
Output for 7.0.0 - 7.1.0
float(NAN) bool(true) bool(true) bool(true) bool(true) bool(false) ---- float(INF) bool(false) bool(false) bool(true)
Output for 5.4.0 - 5.6.28, hhvm-3.10.0 - 3.12.0
float(NAN) bool(false) bool(false) bool(false) bool(false) bool(false) ---- float(INF) bool(false) bool(false) bool(true)
Output for 4.3.6 - 5.3.29
float(NAN) bool(true) bool(true) bool(true) bool(true) bool(false) ---- float(INF) bool(true) bool(true) bool(false)
Output for 4.3.0 - 4.3.5
Notice: Use of undefined constant NAN - assumed 'NAN' in /in/MP38b on line 3 Notice: Use of undefined constant NAN - assumed 'NAN' in /in/MP38b on line 3 Notice: Use of undefined constant NAN - assumed 'NAN' in /in/MP38b on line 3 Notice: Use of undefined constant NAN - assumed 'NAN' in /in/MP38b on line 3 Notice: Use of undefined constant NAN - assumed 'NAN' in /in/MP38b on line 3 Notice: Use of undefined constant NAN - assumed 'NAN' in /in/MP38b on line 3 Notice: Use of undefined constant NAN - assumed 'NAN' in /in/MP38b on line 3 Notice: Use of undefined constant NAN - assumed 'NAN' in /in/MP38b on line 4 Notice: Use of undefined constant NAN - assumed 'NAN' in /in/MP38b on line 4 string(3) "NAN" bool(false) bool(false) bool(false) bool(false) bool(true) ---- Notice: Use of undefined constant INF - assumed 'INF' in /in/MP38b on line 6 Notice: Use of undefined constant INF - assumed 'INF' in /in/MP38b on line 6 Notice: Use of undefined constant INF - assumed 'INF' in /in/MP38b on line 6 Notice: Use of undefined constant INF - assumed 'INF' in /in/MP38b on line 6 Notice: Use of undefined constant INF - assumed 'INF' in /in/MP38b on line 6 Notice: Use of undefined constant INF - assumed 'INF' in /in/MP38b on line 6 Notice: Use of undefined constant INF - assumed 'INF' in /in/MP38b on line 6 string(3) "INF" bool(false) bool(false) bool(true)