Re: Iterable Type Hint
| From: | Stas Malyshev | Date: | Fri, 13 Jul 2012 17:01:17 +0000 |
| Subject: | Re: Iterable Type Hint | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-61208@lists.php.net to get a copy of this message | ||
Hi!
> I wouldn't call it ad hoc, actually, but more a recognition of what practices
> and patterns are now occurring. A few years ago, I'd have type-hinted on array
I do not think strict typing is a right way to do it. Strict typing has
specific meaning in many languages, including (unfortunately, IMHO) in
PHP - that the value has specific type. (Ab)using it to mean "the value
conforms to specific multi-type use case" seems not the right way to me,
unless we design very different type system from what we have now - but
even then we should start with designing it, not with ad-hoc use cases.
--
Stanislav Malyshev, Software Architect
SugarCRM: http://www.sugarcrm.com/
(408)454-6900 ext. 227