May 24, 2012

Post: Integers in PHP, running with scissors, and portability

…, and PHP decides to treat them as integers, you’re in trouble. Oh wait, no – that’s on 32-bit platforms only! PHP int…” integer type must be at least 64 bits in size. By now, most compilers support that part perfectly. However, designers of PHP 5… but there’s no native 64-bit integer type in PHP. Let me remind that built-in “int” might be 64-bit, but then…

Post: PHP vs. BIGINT vs. float conversion caveat

…. I had already written about the mess that 64-bit integers are in PHP. But if the numbers you use do not cover… that PHP floats are in fact doubles, i.e. double-precision 64-bit numbers. They have 52 bits for mantissa, and integer values…) helped in all cases. However at the moment the option is neither mentioned in the online documentation, nor explained clearly in php.ini. So…

Comment: Integers in PHP, running with scissors, and portability

[...] Integers in PHP, running with scissors, and portability | MySQL Performance Blog (tags: php integer bug) [...]

Comment: Integers in PHP, running with scissors, and portability

[...] Comment on Integers in PHP, running with scissors, and portability… …horrors of PHP, I’m just being an elitist old bitch, with my closures and namespaces and garbage collection which works properly, and what… [...]

Comment: Integers in PHP, running with scissors, and portability

[...] “Integers in PHP, running with scissors, and portability“. MySQL Performance Blog (27 March 2007). Retrieved on [...]

Comment: Integers in PHP, running with scissors, and portability

[...] MySQL Performance Blog » Integers in PHP, running with scissors, and portability [...]

Comment: Integers in PHP, running with scissors, and portability

MySQL Performance Blog: Integers in PHP, running with scissors, and portability… …

Comment: Integers in PHP, running with scissors, and portability

… big problem in PHP if you try to have your code working on both 32 and 64 bit machines in parallel. In PHP, the variable size of the integer type is a “feature” (probably the developers… bits signed). PHP does not support unsigned integers.” You will also run into problems when doing bit shifting operations in your code or…

Comment: MySQL automatic data truncation can backfire

… fact 64bit php returns a 64 bit signed integer which wont wrap at the same position as a 32bit signed integer. I’ve… is negative and then store all crc32 values as unsigned integers in mysql.

Comment: PHP vs. BIGINT vs. float conversion caveat

… on PHP vs. BIGINT vs. float conversion caveatHere’s a quick excerpt Sometimes you need to work with big numbers in PHP (gulp…. I had already written about the mess that 64-bit integers are in PHP. But if the numbers you use do not cover…, floats might save the day. The trick is that PHP floats are in fact doubles, i.e. double-precision 64-bit numbers…