Dynadot โ€” .com Registration $8.99

[PHP] Explain This!

Spaceship Spaceship
Watch

beaver6813

Established Member
Impact
16
Heres one for you guys! I retrieve variables from an xml parser using simpelxml. It gives me a number in string format:
PHP:
var_dump($HandshakeTime);
Outputs:
Code:
string(13) "1255970476404"
I need to convert it into an integer so i'll do it this way:
PHP:
var_dump(($HandshakeTime+0));
Outputs:
Code:
int(2147483647)

What the deuce! How does the entire value change when converted to an integer?!
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
AfternicAfternic
Overflow. 2147483647 is the maximum value for a signed 32-bit integer.
 
0
•••
Aha! I've never come across this before lol, is there any way around this limitation?
 
0
•••
Try using a library like BCmath if available on your platform (phpinfo will tell you).
 
0
•••
0
•••
Dynadot โ€” .com Registration $8.99Dynadot โ€” .com Registration $8.99
Appraise.net
Unstoppable Domains
Domain Recover
NameMaxi - Your Domain Has Buyers
  • The sidebar remains visible by scrolling at a speed relative to the pageโ€™s height.
Back