Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialTimur Uzel
Courses Plus Student 3,383 PointsWhen i gettype(1.1) it returns a double, not a float. Why is this?
When I type in...
<?php echo gettype(1.1) ?>
it returns a double, not a float.
2 Answers
Adam Young
15,791 PointsFrom http://php.net/manual/en/function.gettype.php:
"double" (for historical reasons "double" is returned in case of a float, and not simply "float")
In PHP, at least, a float and double are the same datatype.
Gonzalo Blasco
11,927 PointsIt looks doubles is the new float...