Re: type hinting
| From: | Sam Barrow | Date: | Fri, 04 Jan 2008 19:19:46 +0000 |
| Subject: | Re: type hinting | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-34470@lists.php.net to get a copy of this message | ||
On Fri, 2008-01-04 at 19:19 +0000, Alain Williams wrote:
> On Fri, Jan 04, 2008 at 02:06:09PM -0500, Sam Barrow wrote:
>
> > > No, it's not better. Having GD image instead of mysql connection is not
> > > better than having integer in any way. It would just produce different
> > > error message, so what?
> >
> > That's actually very true.
>
> But the liklyhood is that the programmer will pass an int/float/string/...
> rather than the wrong resource type. 'resource' will still be very useful
> and catch many errors without being 100% perfect.
Also true, and the "resource" hint is still useful for documentation and
clarity of code. Better than no type hint I'd say.