Difference between float and double in php? Ask Question

Difference between float and double in php? Ask Question

I have this code

$vad = 1.1;

print gettype($vad);

var_dump($vad);

this will output:

double
float(1.1) 

So it is double or float in php?

ベストアンサー1

There is no difference in PHP. float, double or real are the same datatype.

At the C level, everything is stored as a double.
The real size is still platform-dependent.

See the manual for more details:
http://www.php.net/manual/en/language.types.float.php

おすすめ記事