From http://nz2.php.net/manual/en/language.types.integer.php
"An integer is a number of the set Z = {..., -2, -1, 0, 1, 2, ...}."
Yes, that's nice. Except, this definition of integers does not seem to apply in PHP land. I respectfully request you change this definition to the following:
"In PHP, an integer is a number of the set Z = {-2^32, ... , -1, 0, 1, ..., 2^32-1}. This is markedly smaller than the mathematical definition of integers. Beware!"
All kidding aside, I don't care how big the underlying C datatype is. I want my integers to behave like actual, mathematically defined integers. Which means that a number > 2GB is not actually some horribly large negative number.
Oh coding god in the sky, why didn't python catch on as the newb language of choice? [1]
Edit: Benny Baumann pointed out to me that the size is 2^64 on a 64 bit system, which I grant is larger, but is still retarded. It so happens that many people are running 32 bit web servers for whatever reason. He also found this gem in the PHP source code:
#ifndef LONG_MAX #define LONG_MAX 2147483647L #endif #ifndef LONG_MIN #define LONG_MIN (- LONG_MAX - 1) #endif
Ahem.
| [1] | I feel at pains to point out that I don't choose to code in PHP because I'm a newb. Far from it, in fact. I'm coding in php because Mahara is written in PHP, and as an OSS webapp, it makes sense to code these things in PHP so newbs can hack on it and install it on annoying shared hosting. |
Like this post? Subscribe to my RSS feed and follow me on twitter to hear about new posts early.
Want to share this post? Tweet
Hi and welcome! In 2009 I quit my job to become an entrepreneur, founding 
