Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:84798 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 14197 invoked from network); 15 Mar 2015 02:34:11 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 15 Mar 2015 02:34:11 -0000 Authentication-Results: pb1.pair.com smtp.mail=smalyshev@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=smalyshev@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.220.49 as permitted sender) X-PHP-List-Original-Sender: smalyshev@gmail.com X-Host-Fingerprint: 209.85.220.49 mail-pa0-f49.google.com Received: from [209.85.220.49] ([209.85.220.49:33362] helo=mail-pa0-f49.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 97/52-01144-2AFE4055 for ; Sat, 14 Mar 2015 21:34:10 -0500 Received: by pagr17 with SMTP id r17so27605620pag.0 for ; Sat, 14 Mar 2015 19:34:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=gtGvNwGEkYWeeWv9jxXjjVRMmhuR59fZJ7Bkz7L1oO4=; b=WwT56b2w0WcSxU2taEDx8A9LhEcMyhvO0lE0SJLkm2L05PE/NyVeFIZiTscbW24kW3 41WoRSvEDxhrp012r64U74rLCr8iZco8f4jvY+W43C/B31XwoSy/bZFRG9F1aOSVxykm AKP4lGZwVkJXj4hnhhlcH87VEjA1py666Ega6bwEenp8/MAMGuFdPyq/A4uFznsvj+Ne 6VxvRR6mHVqQH3uJbu4YlE+rvHCVlCkzlfMqi2H2T9FJt1F7f6SRW7FPw2z9I8a0eJni SG//5z1TLjSghVR6LahJinPaF3uVlkCz4qYc9t0kDAg9oEWU4D7JSLQv6cslikBh5R0C w88Q== X-Received: by 10.66.229.34 with SMTP id sn2mr51889712pac.92.1426386846980; Sat, 14 Mar 2015 19:34:06 -0700 (PDT) Received: from Stas-Air.local ([24.32.31.168]) by mx.google.com with ESMTPSA id fx13sm10344946pdb.7.2015.03.14.19.34.06 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 14 Mar 2015 19:34:06 -0700 (PDT) Message-ID: <5504EF9D.1000707@gmail.com> Date: Sat, 14 Mar 2015 19:34:05 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Niklas Keller , PHP Internals References: In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC][PRE-VOTE] In Operator From: smalyshev@gmail.com (Stanislav Malyshev) 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