Created
May 9, 2012 09:53
-
-
Save bdelespierre/2643449 to your computer and use it in GitHub Desktop.
PHP Bug #54547 Workaround
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
// Case 1 | |
// will display '9223372036854775807 equals 9223372036854775808' | |
// bug https://bugs.php.net/bug.php?id=54547 | |
$a = '9223372036854775807'; | |
$b = '9223372036854775808'; | |
if ($a == $b) | |
echo "$a equals $b\n"; | |
else | |
echo "$a not equals $b\" | |
// Case 2 | |
// will display '9223372036854775807 not equals 9223372036854775808' | |
$a = '9223372036854775807'; | |
$b = '9223372036854775808'; | |
if ($a === $b) { | |
echo "$a equals $b\n"; | |
} | |
else { | |
echo "$a not equals $b\n"; | |
} |
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
// Case 1 | |
// will display '9223372036854775807 equals 9223372036854775808' | |
// bug https://bugs.php.net/bug.php?id=54547 | |
$a = '9223372036854775807'; | |
$b = '9223372036854775808'; | |
if ($a == $b) | |
echo "$a equals $b\n"; | |
else | |
echo "$a not equals $b\" | |
// Case 2 | |
// will display '9223372036854775807 not equals 9223372036854775808' | |
$a = '9223372036854775807'; | |
$b = '9223372036854775808'; | |
if ($a === $b) | |
echo "$a equals $b\n"; | |
else | |
echo "$a not equals $b\n"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment