Re: phpng - loss of IS_BOOL
| From: | Andrea Faulds | Date: | Wed, 23 Jul 2014 13:16:42 +0000 |
| Subject: | Re: phpng - loss of IS_BOOL | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-75958@lists.php.net to get a copy of this message | ||
On 23 Jul 2014, at 09:49, Lester Caine <lester@lsces.co.uk> wrote:
> I'm looking for the explanation as to why it HAS to change rather than
> anything else. I can see that using the 64bit value field is overkill,
> but there is still plenty of spare space in the TYPE element to not have
> to create an extra object type? The two types of boolean just need a
> different type_flags entry?
>
> THEN is_false and is_true make sense as macro's of is_bool …
Arguably nothing *has* to change, but this change makes sense. TRUE and FALSE are special values
much like NULL, and there’s no real good reason not to have them be their own types like NULL is,
given the performance benefits and how it makes some types of code easier to write or less
error-prone.
--
Andrea Faulds
http://ajf.me/