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
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
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_