What is the result of the loose comparison ‘1e3’ == 1000 in PHP?

PHP Intermediate Hard

PHP Intermediate — Hard

What is the result of the loose comparison ‘1e3’ == 1000 in PHP?

Key points

  • Loose comparison triggers numeric conversion
  • Scientific notation strings are parsed as numbers
  • 1000.0 == 1000 is true

Ready to go further?

Related questions