Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:83363 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 43245 invoked from network); 20 Feb 2015 23:38:06 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 Feb 2015 23:38:06 -0000 Authentication-Results: pb1.pair.com smtp.mail=larry@garfieldtech.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=larry@garfieldtech.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain garfieldtech.com from 66.111.4.28 cause and error) X-PHP-List-Original-Sender: larry@garfieldtech.com X-Host-Fingerprint: 66.111.4.28 out4-smtp.messagingengine.com Received: from [66.111.4.28] ([66.111.4.28:56177] helo=out4-smtp.messagingengine.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 9B/15-14173-D55C7E45 for ; Fri, 20 Feb 2015 18:38:05 -0500 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 85EA020D16 for ; Fri, 20 Feb 2015 18:38:01 -0500 (EST) Received: from frontend1 ([10.202.2.160]) by compute5.internal (MEProxy); Fri, 20 Feb 2015 18:38:02 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=x-sasl-enc:message-id:date:from :mime-version:to:subject:references:in-reply-to:content-type :content-transfer-encoding; s=smtpout; bh=+cdqMrZsv4tQOvJGH5NYBY buJU4=; b=YxjxmCZb7t8wQe/cpRiMsaYW4YOXkPAyt0qcIalR2reL55CXhTq72X IIbgW4g4CP23TyEkTSuJ7DHU+9JtX/cpdgDKNIT7+uPnX6Is8O97Gd3vxq0eeJ1O vabzL6CWJaAeTAq41QjtY5r5q3j+K3dAKYPbYpMrEX4iMshKO2Q0I= X-Sasl-enc: g39Pc6zE4F3eN989YdCi/LTss2o0+w4fa1s2frVDut1f 1424475481 Received: from [192.168.0.25] (unknown [190.158.192.40]) by mail.messagingengine.com (Postfix) with ESMTPA id 89191C00295 for ; Fri, 20 Feb 2015 18:38:01 -0500 (EST) Message-ID: <54E7C558.7030900@garfieldtech.com> Date: Fri, 20 Feb 2015 18:38:00 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: internals@lists.php.net References: In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC][Discussion] In Operator From: larry@garfieldtech.com (Larry Garfield) On 02/20/2015 07:54 AM, Niklas Keller wrote: > Hi internals, > > "In Operator" is now in discussion phase. > >> This RFC adds a new in operator which simplifies contains checks for strings and arrays. >> Currently, we have to usein_array($needle, $haystack, true) or strpos($haystack, $needle) !== false. >> These functions have a inconsistent parameter order, so it's hard to remember which is the right one >> for each. The in operator makes these checks way more readable. Additionally, it also works for Traversable. > https://wiki.php.net/rfc/in_operator > > Question: The timline says "Line up any remaining RFCs that target PHP > 7.0.", does that mean RFCs have to > start voting on Mar 15 or should the vote end there? > > It would really make sense to vote on this RFC after there has been a > vote on https://wiki.php.net/rfc/context_sensitive_lexer. > > Regards, Niklas While I love the idea, strict type comparison for in would, in essence, be a toe-dip into the scalar strict typing world (see other thread) that would be very confusing. Consider: if (3 in $_GET['filters']) { ... } That would always be false, because $_GET is always strings. To make that work I'd need to first cast all of the elements in that array to ints... which I'm not actually sure how to do cleanly. I'd much rather we tighten up the rules around implicit casts generally, as discussed elsewhere, and then allow those "loose but not as loose as we have now" rules here. --Larry Garfield