On 09.06.2010, at 12:01, André Rømcke wrote:

> Example:
> function fetchById( int $id, bool $asObject = true )
> 
> If weak type hints are accepted, type hints would be useless in this case as
> consumer can do something strange as fetchById( true, 'foo' ) (Obviously I'm
> not saying anyone would do this intentionally, but in a large application
> you might not have full oversight and can unintentionally pass variables of
> wrong type or in wrong order causing issues to surface much later as there
> are no strict type checks that would detect the mistake immediately while
> developing).


please read RFC's you comment on (well the following was added to the RFC 2 or 
maybe even 3 weeks ago):
in your above example there would be data loss in the type cast and therefore 
there would not be silent auto casting.

again there is only silent automatic casting being proposed in the case of when 
there is no data loss:
"1" <=> 1

but "1abc" would not silently cast to 1

etc.

anyway .. can we conclude this discussion? probably best if someone who is more 
or less impartial would handle the call fore vote and figure out some sensible 
way to let people vote on the various solutions that are proposed.

regards,
Lukas Kahwe Smith
m...@pooteeweet.org




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

Reply via email to