Re: type hinting
| From: | Sam Barrow | Date: | Fri, 04 Jan 2008 17:48:22 +0000 |
| Subject: | Re: type hinting | ||
| References: | 1 2 3 4 5 6 7 8 9 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-34427@lists.php.net to get a copy of this message | ||
On Fri, 2008-01-04 at 17:46 +0000, Alain Williams wrote:
> On Fri, Jan 04, 2008 at 12:11:41PM -0500, Sam Barrow wrote:
>
> > Exactly. I just added the "mixed" type hint which is the same as using
> > no type hint. The new patch is attached.
> >
> > Extra keywords (real, long, double, etc.) have been taken out. The
> > available type hints are now mixed, int, float, bool, string, scalar,
> > num, resource, and object. And of course array and class type hints
> > still work.
>
> I notice that you use strcasecmp() to compare type name. I thought that we were moving
> away from case independence, ie the type should be 'int' or perhaps 'INT' -
> whatever
> we agree on it should have a defined capitalisation.
Oh ok. Well I assumed it would be case sensitive like variables but you
do have a point, many keywords in PHP are not case sensitive. This is
something that can be easily changed depending on what people want.
> Just an off the wall thought ... if the type is not a known scalar type or class, then check to
> see if the
> word is a constant ... could be interesting .... aka C's typedefs.
>