Hello Cristian,

Sunday, January 6, 2008, 7:42:58 PM, you wrote:

> 2008/1/5, Alain Williams <[EMAIL PROTECTED]>:

>> "1" and 1 should both be acceptable to type hint 'int'.

> No way, "1" is an string, not an integer.

Well that is the whole issue here. In PHP "1" is pretty equal to 1 in any
function. It only makes a difference in ===. Now type hints are not exact
either, the allow the type itself or any subclass. And any integer can also
be a float so that would be a kind of subclass. Further more all internal
functions that use an integer request that in one of two ways. First way is
that it uses old style parameter parsing with a conversion macro or it uses
new stle parameter parsing API which does conversion internally. Now what we
would want is most likely use the hints for the stuff we already have. And
that would mean it would need to behave in the way of the stuff we already
have. Why? Becasue we do so for the existing type hints as well.

That said I would only agree to type hints if we make them respect existing
PHP conversion rules.

Best regards,
 Marcus

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

Reply via email to