Dynadot Aftermarket: discover domain gems worth investing in. Visit our aftermarket.

[PHP] Explain This!

SpaceshipSpaceship
SpaceshipSpaceship
SpaceshipSpaceship
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
Close
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
Overflow. 2147483647 is the maximum value for a signed 32-bit integer.
 
0
Close
Aha! I've never come across this before lol, is there any way around this limitation?
 
0
Close
Try using a library like BCmath if available on your platform (phpinfo will tell you).
 
0
Close
0
Close
DomainEasy: white label portfolios are live. Enable yours.

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com

NamePros updates

Filters for activity feeds
Your news feed, Latest activity, and the activity tab on profiles now have filter buttons: All, Posts, Quick replies, and Other. Your...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back