3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php echo ('1' == '1' ? 'true' : 'false') . " ('1' == '1')\n"; echo ('2' == '1' ? 'true' : 'false') . " ('2' == '1')\n"; echo ('0' == '0x0' ? 'true' : 'false') . " ('0' == '0x0')\n"; echo ('0' == '00' ? 'true' : 'false') . " ('0' == '00')\n"; echo ('1e1' == '10' ? 'true' : 'false') . " ('1e1' == '10')\n"; echo ('1E1' == '10' ? 'true' : 'false') . " ('1E1' == '10')\n"; echo ('1e-1' == '0.1' ? 'true' : 'false') . " ('1e-1' == '0.1')\n"; echo ('1E-1' == '0.1' ? 'true' : 'false') . " ('1E-1' == '0.1')\n"; echo ('+1' == '1' ? 'true' : 'false') . " ('+1' == '1')\n"; echo ('+0' == '-0' ? 'true' : 'false') . " ('+0' == '-0')\n"; echo ('0.99999999999999994' == '1' ? 'true' : 'false') . " ('0.99999999999999994' == '1')\n"; echo ('0.99999999999999995' == '1' ? 'true' : 'false') . " ('0.99999999999999995' == '1')\n"; echo ("\n1" == '1' ? 'true' : 'false') . " (\"\\n1\" == '1')\n"; echo ("1\n" == '1' ? 'true' : 'false') . " (\"1\\n\" == '1')\n";
based on 4KA8M
Output for hhvm-3.10.0 - 3.13.2, 7.0.0 - 7.1.0
true ('1' == '1') false ('2' == '1') false ('0' == '0x0') true ('0' == '00') true ('1e1' == '10') true ('1E1' == '10') true ('1e-1' == '0.1') true ('1E-1' == '0.1') true ('+1' == '1') true ('+0' == '-0') false ('0.99999999999999994' == '1') true ('0.99999999999999995' == '1') true ("\n1" == '1') false ("1\n" == '1')
Output for 4.3.0 - 5.6.28
true ('1' == '1') false ('2' == '1') true ('0' == '0x0') true ('0' == '00') true ('1e1' == '10') true ('1E1' == '10') true ('1e-1' == '0.1') true ('1E-1' == '0.1') true ('+1' == '1') true ('+0' == '-0') false ('0.99999999999999994' == '1') true ('0.99999999999999995' == '1') true ("\n1" == '1') false ("1\n" == '1')