Skip to content

Instantly share code, notes, and snippets.

@kotnik
Created July 3, 2013 08:47
Show Gist options
  • Select an option

  • Save kotnik/5916437 to your computer and use it in GitHub Desktop.

Select an option

Save kotnik/5916437 to your computer and use it in GitHub Desktop.
Beware of ==
<?php
// == is not transitive
if (0 == FALSE) {
echo "0 == FALSE\n";
}
if ("string" == TRUE) {
echo "'string' is TRUE\n";
}
if (0 == "string") {
echo "FALSE == TRUE\n";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment