Skip to content

Instantly share code, notes, and snippets.

@kobake
Last active December 21, 2015 18:09
Show Gist options
  • Save kobake/6345208 to your computer and use it in GitHub Desktop.
Save kobake/6345208 to your computer and use it in GitHub Desktop.
trueになる。
<?php
$a = "10a";
$b = 10;
if($a == $b){
print "true";
}
else{
print "false";
}
@kobake
Copy link
Author

kobake commented Aug 26, 2013

http://stackoverflow.com/questions/9257685/weird-php-string-integer-comparison-and-conversion

If I recal correcly PHP 'casts' the two variables to lowest possible type.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment