What is the result of the comparison var_dump(0 == ‘php’);?

PHP Intermediate Medium

PHP Intermediate — Medium

What is the result of the comparison var_dump(0 == ‘php’);?

Key points

  • Loose comparison triggers type juggling
  • Non-numeric strings convert to 0 in numeric contexts
  • Comparison results in a boolean value

Ready to go further?

Related questions