3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo "NAN < 1.0: "; var_dump(NAN < 1.0); echo "NAN <= 1.0: "; var_dump(NAN <= 1.0); echo "NAN == 1.0: "; var_dump(NAN == 1.0); echo "NAN != 1.0: "; var_dump(NAN != 1.0); echo "NAN === 1.0: "; var_dump(NAN === 1.0); echo "NAN !== 1.0: "; var_dump(NAN !== 1.0); echo "NAN > 1.0: "; var_dump(NAN > 1.0); echo "NAN >= 1.0: "; var_dump(NAN >= 1.0);
Output for 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.40, 7.0.23 - 7.0.33, 7.1.9 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.28, 7.4.0 - 7.4.16, 8.0.0 - 8.0.3
NAN < 1.0: bool(false) NAN <= 1.0: bool(false) NAN == 1.0: bool(false) NAN != 1.0: bool(true) NAN === 1.0: bool(false) NAN !== 1.0: bool(true) NAN > 1.0: bool(false) NAN >= 1.0: bool(false)
Output for 4.3.6 - 4.3.11, 4.4.0 - 4.4.9, 5.0.0 - 5.0.5, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17, 5.3.0 - 5.3.29, 7.0.0 - 7.0.22, 7.1.0 - 7.1.8
NAN < 1.0: bool(true) NAN <= 1.0: bool(true) NAN == 1.0: bool(false) NAN != 1.0: bool(true) NAN === 1.0: bool(false) NAN !== 1.0: bool(true) NAN > 1.0: bool(true) NAN >= 1.0: bool(true)
Output for 4.3.0 - 4.3.5
NAN < 1.0: Notice: Use of undefined constant NAN - assumed 'NAN' in /in/XRDRs on line 3 bool(true) NAN <= 1.0: Notice: Use of undefined constant NAN - assumed 'NAN' in /in/XRDRs on line 4 bool(true) NAN == 1.0: Notice: Use of undefined constant NAN - assumed 'NAN' in /in/XRDRs on line 5 bool(false) NAN != 1.0: Notice: Use of undefined constant NAN - assumed 'NAN' in /in/XRDRs on line 6 bool(true) NAN === 1.0: Notice: Use of undefined constant NAN - assumed 'NAN' in /in/XRDRs on line 7 bool(false) NAN !== 1.0: Notice: Use of undefined constant NAN - assumed 'NAN' in /in/XRDRs on line 8 bool(true) NAN > 1.0: Notice: Use of undefined constant NAN - assumed 'NAN' in /in/XRDRs on line 9 bool(false) NAN >= 1.0: Notice: Use of undefined constant NAN - assumed 'NAN' in /in/XRDRs on line 10 bool(false)