3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php var_dump(INF === INF); var_dump(NAN === NAN); var_dump(INF == INF); var_dump(NAN == NAN); var_dump(INF - INF); var_dump(NAN - NAN); var_dump(INF + INF); var_dump(NAN + NAN);
Output for 5.4.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
bool(true) bool(false) bool(true) bool(false) float(NAN) float(NAN) float(INF) float(NAN)
Output for 4.3.6 - 5.3.29
bool(true) bool(false) bool(false) bool(false) float(NAN) float(NAN) float(INF) float(NAN)
Output for 4.3.0 - 4.3.5
Notice: Use of undefined constant INF - assumed 'INF' in /in/Y41KW on line 2 Notice: Use of undefined constant INF - assumed 'INF' in /in/Y41KW on line 2 bool(true) Notice: Use of undefined constant NAN - assumed 'NAN' in /in/Y41KW on line 3 Notice: Use of undefined constant NAN - assumed 'NAN' in /in/Y41KW on line 3 bool(true) Notice: Use of undefined constant INF - assumed 'INF' in /in/Y41KW on line 5 Notice: Use of undefined constant INF - assumed 'INF' in /in/Y41KW on line 5 bool(true) Notice: Use of undefined constant NAN - assumed 'NAN' in /in/Y41KW on line 6 Notice: Use of undefined constant NAN - assumed 'NAN' in /in/Y41KW on line 6 bool(true) Notice: Use of undefined constant INF - assumed 'INF' in /in/Y41KW on line 8 Notice: Use of undefined constant INF - assumed 'INF' in /in/Y41KW on line 8 int(0) Notice: Use of undefined constant NAN - assumed 'NAN' in /in/Y41KW on line 9 Notice: Use of undefined constant NAN - assumed 'NAN' in /in/Y41KW on line 9 int(0) Notice: Use of undefined constant INF - assumed 'INF' in /in/Y41KW on line 11 Notice: Use of undefined constant INF - assumed 'INF' in /in/Y41KW on line 11 int(0) Notice: Use of undefined constant NAN - assumed 'NAN' in /in/Y41KW on line 12 Notice: Use of undefined constant NAN - assumed 'NAN' in /in/Y41KW on line 12 int(0)