Re: [RFC][PRE-VOTE] In Operator

From: Date: Sun, 15 Mar 2015 02:34:05 +0000
Subject: Re: [RFC][PRE-VOTE] In Operator
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-84798@lists.php.net to get a copy of this message
Hi! > I'd like to announce that I'll open the vote for the in operator later that day. > You can find the RFC here: https://wiki.php.net/rfc/in_operator I think this operator is unnecessary - we already have perfectly good function that does the same. Also, since it checks the values and not the keys, it would be useless for the same use case one would most frequently use "in" in Python and such - for checking if something is in a set of values. Since efficient implementation of the set in PHP would have the value being sought as key, "in" would be useless, unless much slower iterative implementation is chosen. Also, because it includes different (and inconsistent) implementation for strings, if you have ("foo" in $bar === true) , you don't know if $bar is an array that includes string "foo" or a string that has "foo" as a substring. I don't think it's good that operator would mix these two cases. -- Stas Malyshev smalyshev@gmail.com

« previous php.internals (#84798) next »