Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Comparison of PHP equality (== double equals) and identity (=== triple equals)

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 85
    Comment on it

    Hello Readers !

    == compares the values of variables for equality, type casting as necessary. === checks if the two variables are of the same type AND have the same value.

    Examples:

    1 === 1: true
    1 == 1: true
    1 === "1": false // 1 is an integer, "1" is a string
    1 == "1": true // "1" gets casted to an integer, which is 1
    "foo" === "foo": true // both operands are strings and have the same value
    

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: