Why does the gettype() say it's a double but var_dump() says float?
$number = 1234567890123456789;
echo "Number: {$number} is a ". gettype($number) . "\n";
var_dump($number);
Response:
Number: 1.23456789012E+18 is a double
float(1.23456789012E+18)
They're the same thing http://php.net/manual/en/language.types.float.php
Directly from PHP.net (gettype()):
Possibles values for the returned string are:
... "double" (for historical reasons "double" is returned in case of a float, and not simply "float") ...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With