Paul's Programming Notes
PostsRSSGithub

Triple Equals Sign In Php

19 Oct 2012

http://stackoverflow.com/questions/80646/how-do-the-equality-double-equals-and-identity-triple-equals-comparis

Since PHP uses $ to declare variables (and not int, etc), one can run into issues with an if statement being unintentionally true.

For example, 0 == null.

The triple equals sign (===) allows you to prevent these cases by only returning true if the two inputs are the same type and value.

So, 0 === null is not true. Also, 0 === “0” is not true either.

php

Related posts

  • Difference Between Echo and Print In PHP 19 Oct 2012
  • PHP Date Variables 19 Oct 2012
  • Sizeof() vs Count() in PHP 22 Oct 2012
© 2026. All rights reserved.