Last active
August 29, 2015 14:13
-
-
Save hipsterjazzbo/e033f437d81d25cb9265 to your computer and use it in GitHub Desktop.
Equals signs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// One means "Assign this value to this variable" | |
$number = 1; // This one is an integer (whole number) | |
$anotherNumber = "1"; // This one is a string | |
// Two means "Are these the same value?" | |
if ($number == $anotherNumber) { | |
// This will be true | |
} | |
// Three means "Are these the same vale AND type? | |
if ($number === $anotherNumber) { | |
// This will not be true, because although $number and $anotherNumber | |
// are both 1, one is an integer type and the other is a string type | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment