I have an array of large integer values. When printed out with print_r()
, the values are correct but when I assign the values inside of the array to variables and print with printf
for precision, the values are different.
$this->v0 = $this->myArray[0];
$this->v1 = $this->myArray[1];
$this->v2 = $this->myArray[2];
$this->v3 = $this->myArray[3];
print_r($this->myArray);
printf("v0: %.0F | v1: %.0F | v2: %.0F | v3: %.0F\n", $this->v0, $this->v1, $this->v2, $this->v3);
this prints out
Array
(
[0] => -8845908906223371573
[1] => -7688304550669780974
[2] => -7337754985657963041
[3] => -8842903914599747060
)
v0: -8845908906223371264 | v1: -7688304550669780992 | v2: -7337754985657963520 | v3: -8842903914599746560
edit: I am on Mac OS X 10.11.3 and using PHP 7.0.4
Really not sure what is happening here but any help would be great. Thanks!