Answer the question
In order to leave comments, you need to log in
PHP and strings close to maxint?
Experts are invited to "think about it")
Found a strange behavior of such code.
$id1 = '9223372036854775888';<br/>
$id2 = '9223372036854775899';<br/>
var_dump($id1 == $id2);<br/>
Answer the question
In order to leave comments, you need to log in
Make a small post in the feed, everyone should know this. The “bug” has been hanging since 2007, so it is unlikely that anything will change: bugs.php.net/bug.php?id=43304
Dangerous thing, I also have true ==, === falls.
when specifying the type (string) even true
Чем нужно руководствоваться чтобы такое придумать?
The fact that PHP is originally a template engine works with text data (script input from a web server, entries in the database, files are all strings), but the data is often numeric in nature. So they "facilitated" the life of the developers, so that it was not necessary to bring types for every sneeze.
I remember accidentally stumbled upon this dubious "feature", compared something like this: $str1. 'fake' == $str2. 'fake'
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question