3v4l.org

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