Re: [PATCH] Making in_array a language operator
| From: | Johannes Schlüter | Date: | Sun, 13 Nov 2011 11:22:36 +0000 |
| Subject: | Re: [PATCH] Making in_array a language operator | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-56308@lists.php.net to get a copy of this message | ||
On Sun, 2011-11-13 at 03:10 +0100, Johannes Schlüter wrote:
> For 5.5 I also have doubts whether it's worth the additional keyword and
> opcode. Yes it will, most likely, but this is an extension to the
> grammar ...
I meanwhile did a quick check on google codesearch. I found a few cases
where "in" was used as property or method name. Notable cases there are
zeta components and doctrine2 which this patch would break.
Two more comments I wanted to make:
Your using is_equal_function, this does a == comparison. People will
stumble over $a = 0; $a in ["a", "b", "c", "it's easy as one
two
three"]; which will be true. This is the consistent and correct
behaviour for the language but people will ask for a "strict" mode.
For converting functions into opcodes - aren't there more relevant
candidates? strlen() or such come to mind. And no, I won't make them
constructs either.
johannes