Re: [RFC] Type hints (parameter and return value)
| From: | Paul Biggar | Date: | Thu, 17 Apr 2008 18:31:54 +0000 |
| Subject: | Re: [RFC] Type hints (parameter and return value) | ||
| References: | 1 2 3 4 5 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-37110@lists.php.net to get a copy of this message | ||
Hi,
On Thu, Apr 17, 2008 at 8:22 PM, Stanislav Malyshev <stas@zend.com> wrote:
> > > If you talk about consistency, you should remember that right now no
> > > function and no feature in PHP relies on strict checking of primitive
> types.
> > >
> >
> > That is not the case (or I am very much mistaken). In particular,
> > is_int, which I mentioned in my email, is predicated on the IS_LONG
> > type only.
> >
>
> Read that "no function except for a tiny handful of very special cases like
> is_* and serializes and probably one or two other functions that I forgot",
> ok?
is_* are the important functions, since they are the ones which most
resemble the type hints under discussion. Up until now, anyone
implementing this in user-land would use is_int(). It makes perfect
sense that type hints should mimic this behaviour. Not doing so would
be very inconsistent, and so confusing.
Paul
--
Paul Biggar
paul.biggar@gmail.com