Skip to content

Instantly share code, notes, and snippets.

@hipsterjazzbo
Last active August 29, 2015 14:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hipsterjazzbo/e033f437d81d25cb9265 to your computer and use it in GitHub Desktop.
Save hipsterjazzbo/e033f437d81d25cb9265 to your computer and use it in GitHub Desktop.
Equals signs
<?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