Re: [PHP-DEV] PHP Integer Bug

2011-11-19 Thread Gustavo Lopes
On Sat, 19 Nov 2011 13:46:35 -, Paul Dragoonis wrote: [...] CODE --- $s = "2433078805"; var_dump($s); var_dump((int) $s); exit; - EXPECTED - string(10) "2433078805" int(2433078805) - ACTUAL - string(10) "2433078805" int(2147483647) Anthony has already explained

Re: [PHP-DEV] PHP Integer Bug

2011-11-19 Thread Paul Dragoonis
Thanks for the response guys. It wasn't important that I casted my value I was just being pedantic in the first place. Removing the cast stops be from being hit with INT_MAX and INT_SIZE. Cheers! Paul Dragoonis. On Sat, Nov 19, 2011 at 1:53 PM, Anthony Ferrara wrote: > If I'm not mistaken, that

Re: [PHP-DEV] PHP Integer Bug

2011-11-19 Thread Anthony Ferrara
If I'm not mistaken, that is to be expected. That's because you're on a 32 bit system, so the maximum possible int (PHP_INT_MAX) is 2147483647. Now, normally PHP could cast to a float to get the larger number in, but you explicitly cast it to an integer, so it had to truncate the value. Try var_

[PHP-DEV] PHP Integer Bug

2011-11-19 Thread Paul Dragoonis
Hey guys, I don't have a dev environment on my mac here so I can't upgrade to TRUNK to test so I'm relying on someone on the internals list to test this. PHP INFO 5.3.1 -- ISSUE Simple integer work, converting it from being wrapped in a zval.type of string, into int. Same valu