On 2012-07-12, Stas Malyshev <smalys...@sugarcrm.com> wrote:
> > For non-interchangeable types it is already strict by definition. I
> > don't see a problem with type hints that make life easier on both the
> > caller (by generating better error messages) and the callee (by having
> > to write less boilerplate type verification code).
>
> It doesn't make the life of the caller easier. On the contrary, it makes
> each call into a minefield - will it blow up with a system-level error
> when you call it? 

I think you're reading way more into this, or didn't read the same
sample I did from Anthony. 

foreach() allows an array or a Traversable object. The proposal is to
create a typehint that spans the set of (array + Traversable) so that
folks don't have to do a check in each and every method where they want
to accept both so they can iterate. I've written the same or similar
checks to what Anthony posted hundreds of times, and seen it many, many
more than that.

-- 
Matthew Weier O'Phinney
Project Lead            | matt...@zend.com
Zend Framework          | http://framework.zend.com/
PGP key: http://framework.zend.com/zf-matthew-pgp-key.asc

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

Reply via email to