Skip to content

Instantly share code, notes, and snippets.

@bdelespierre
Created May 9, 2012 09:53
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 bdelespierre/2643449 to your computer and use it in GitHub Desktop.
Save bdelespierre/2643449 to your computer and use it in GitHub Desktop.
PHP Bug #54547 Workaround
// 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";
}
// 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