On Jan 6, 2008 9:23 PM, Markus Fischer <[EMAIL PROTECTED]> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi,
>
> Hannes Magnusson wrote:
> | No, the comment is correct.
> |
> | "for historical [read: BC] reasons "double" is returned in case of a
> | float, and not simply "float""
> |
> | See http://docs.php.net/settype && http://docs.php.net/gettype
>
> Thanks for the pointers, but I don't quite understand what "deprecate"
> now means.

It means that maybe someday it will be removed. Unlikely? Sure, but
the preferred name is 'float' so why not use it?


> Doing gettype(1.5) returns "double". There's not way that gettype()
> returns "float".

Right. Due to historical reasons this functions returns 'double'.
Just like for historical reasons implode() can take its argument in
either order.


> I don't see the implications of this "deprecation" here. What does it
> say? The comment in the sourceis there since around 2002 or so. But
> there aren't plans to change the behavior or gettype(), are there?

It means that in PHP the type name is 'float' and referred to as
'float' throughout the manual
For convenience you can use "double" (is_double($f), (double)$f,
settype($f, "double")..), just like you can use is_integer() instead
of is_int()... :)


-Hannes

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to