On Sun, 2008-01-06 at 23:15 +0100, Stefan Esser wrote:
> Hi Marcus,
> > That said I would only agree to type hints if we make them respect existing
> > PHP conversion rules
> if "type hints" are supposed to convert data, then they are wrongly
> named. Then they should be better called "implicit typecasting".
> However "implicit typecasting" is not really usefull for PHP userland
> code and therefore noone will use it, because you even loose
> the benefit to detect wrong data type in a parameter, because nearly
> everything can be casted to a number. And therefore other
> applications like source code scanners or optimizers will not have the
> same benefit.
> 
> So in short I believe that people insist that "1" should be type casted
> to 1 because if it is implemented that way the whole feature makes no
> sense anymore and is useless and in the end is not implemented...
> 
> Stefan Esser

The main flaw in type conversion hinting is that it's nearly pointless.
Why convert the type at function call? PHP will automatically juggle the
type depending on the variable's destination, really no point in
converting it one more time when calling the function.

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

Reply via email to