What is the difference between $a != $b and $a !== $b?

  • $a != $b performs loose comparison, while $a !== $b performs strict comparison
  • $a != $b checks for value equality, while $a !== $b checks for value and type equality
  • There is no difference, both expressions perform the same comparison
  • $a != $b returns a boolean value, while $a !== $b returns an integer value
The $a != $b expression checks for value equality, while the $a !== $b expression checks for both value and type equality. The strict comparison (!==) ensures that the operands are of the same type. Learn more: http://php.net/manual/en/language.operators.comparison.php
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *