On 07/12/2012 09:30 AM, Stas Malyshev wrote: > Hi! > >> Would it be worth while adding a new type hint that checks for this >> condition? I'd propose Iterable: > > I see more and more multiplication of weird ad-hoc type checks. First we > had "callable", now "traversable", then we invent more and more weird > functional types with complex logic. I don't like this development at > all. It's ad-hoc introducing of half-baked, unstandartized, undesigned > strict typing. Strict typing is not a good idea for PHP, and weird > strict typing based on complex conditions hidden from the user is even > worse IMO.
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). You may have a point on the ad-hoc nature of it and that we need to do it once and for all in a more organized fashion, but the basic premise looks ok to me. -Rasmus -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php