Re: type hinting
| From: | Sam Barrow | Date: | Wed, 09 Jan 2008 12:46:53 +0000 |
| Subject: | Re: type hinting | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-34612@lists.php.net to get a copy of this message | ||
On Wed, 2008-01-09 at 00:58 +0200, Tomi Kaistila wrote:
> > Ok, but a scalar becomes useful for a couple of important things.
> > Scalars are all displayable values, that can be stored in a db,
> > outputted, etc. The scalar type hint prevents errors related to objects,
> > resources, and arrays attempting to be stored in the db or echoed.
> True, but honestly I do not see a whole lot of use for this. In a word, it is
> very limited. _Too_ limited to be truly useful in my opinion. It is simple
> statistics; there is more need for specific types than scalars in general,
> when using type hinting.
>
> I do agree that it is a good idea to allow for type hinting scalars in
> general, but it should not be considered a solution. It is more like a
> comfortable add-on.
>
> And to be frank, this really feels like a secondary price (bronze at most). If
> pressed I would go bold say that this really feels like a screw. A way of
> saying that we went out of our way to fix this feature that was limited by
> adding a seemingly useful attribute to it, but in the end still leaving the
> feature limited and not really fixing anything.
A useful addon is better than none though, regardless. I agree this is
not a full solution, but I'd rather have 3 type hints than 2.
> Tomi Kaistila
> PHP Developer
>