On Jan 6, 2008 10:48 PM, Marcus Boerger <[EMAIL PROTECTED]> wrote:
> 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 :-)

Yes, that's a bit scary. Matthew (if I remember correctly) proposed
some months ago to clean the conversion routines and to document them.
The cleanup is actually necessary to minimize confusions and wtf and
the documentations to write tests and stick to them (I'm not a
volunteer :-D


-- 
Pierre
http://blog.thepimp.net | http://www.libgd.org

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

Reply via email to