Web lists-archives.com

[PHP] String conversion to integer




Hi,

I'm testing php 7.1 in my project, and I got a strange problem.

$string = '584e82ed00819';
echo (int)$string;

The above code will output 9223372036854775807 (It's PHP_INT_MAX) in php
7.1.
In php 5.5, the result is: 584.

According to the document:
http://php.net/manual/en/language.types.string.php#language.types.string.conversion

I guess php 7.1 process the string as 584e82, but 5.5 did not.

Any differences for string conversion between 7.1 and 5.5 ?