Search code examples
phpgettypevar-dump

Why does the gettype() say it's a double but var_dump() says float?


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)


Solution

  • They're the same thing http://php.net/manual/en/language.types.float.php