Hello Pierre,
I agree something that is not really a number should not be converted into
a number as it is not compatible but then...what do we do right now?
[EMAIL PROTECTED] PHP_5_3]$ php -r 'var_dump(fmod(12,5));'
make: `sapi/cli/php' is up to date.
float(2)
[EMAIL PROTECTED] PHP_5_3]$ php -r 'var_dump(fmod("12","5"));'
make: `sapi/cli/php' is up to date.
float(2)
[EMAIL PROTECTED] PHP_5_3]$ php -r 'var_dump(fmod("12","5a"));'
make: `sapi/cli/php' is up to date.
float(2)
[EMAIL PROTECTED] PHP_5_3]$ php -r 'var_dump(fmod("12b","5a"));'
make: `sapi/cli/php' is up to date.
float(2)
So we do allow "12b" to be used as 12 even. Oh screw us all :-)
marcus
Sunday, January 6, 2008, 9:53:10 PM, you wrote:
> Hi Marcus,
> On Jan 6, 2008 9:24 PM, Marcus Boerger <[EMAIL PROTECTED]> wrote:
>> That said I would only agree to type hints if we make them respect existing
>> PHP conversion rules.
> That can be a good compromise and may make happy the cons camp.
> However, I would not like to have "11an" returns 0 but raises an
> error. I can live with "[0-1.]" being converted to integer or float as
> it is the case now. Even I would rather prefer a strict hinting and
> let the user of a method or function do the cast (for the reasons
> explained numerous times in this thread).
> --
> Pierre
> http://blog.thepimp.net | http://www.libgd.org
Best regards,
Marcus
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php