Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:91922 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 61054 invoked from network); 24 Mar 2016 19:17:02 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Mar 2016 19:17:01 -0000 Authentication-Results: pb1.pair.com header.from=nikita.ppv@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=nikita.ppv@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.161.179 as permitted sender) X-PHP-List-Original-Sender: nikita.ppv@gmail.com X-Host-Fingerprint: 209.85.161.179 mail-yw0-f179.google.com Received: from [209.85.161.179] ([209.85.161.179:34640] helo=mail-yw0-f179.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 45/C8-15440-D2D34F65 for ; Thu, 24 Mar 2016 14:17:01 -0500 Received: by mail-yw0-f179.google.com with SMTP id h129so71767724ywb.1 for ; Thu, 24 Mar 2016 12:17:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=j4bUDKOLijOcRdJXaRAmgiiMGfut4ohOXjBQxXRctZQ=; b=GwqrBr5AwprMNFrZ2RX61h545+DvOpnAzhPrxYHrXnD7oVal1zMcKhs4g1uBcKoPIr p8s+84nwbBAMC1hC0RpqwuKkh391b0XchL2D3aRWLkQRb9XdNjvjQV+MvW1hqqsEXadE wLDLxkCRI7akxOoZ/rFW6xYagto0BhQtKq9FTpwvPKTAGj2IrOObPHHgCOWkAZwsDXJY Q1p6hvRbfrwMgW93BlLd5VyMQXDFWQFEDuEIdB4VGZ7jnl4M/2vPfRcf770vXn0BxcqS 0N2KDY9Bn2nyVEcRBIdt+/hJ/aerjwb6PtfTCklJzsch/u4OM4S6B0vkXeVowJ4TSqOl NoCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=j4bUDKOLijOcRdJXaRAmgiiMGfut4ohOXjBQxXRctZQ=; b=jNuvlyK0wqgbRRoQ8wn70Ia1Q8jJWaat1xyno1FVRjoIdv1MREmtCgjOk3Zgg6/9xS 8XRoiHeGkPqcyVSJxbMaLk0KNRC6NdmybHl+Mjd39RfJn1MN+lPSrab069+zGIXCDUg8 qx8jsCqidALxeVxQPwCoJEGwHTrJUuzQh1gqhXo0iSH0HNRdjwsc/OPxNX4OF8LRj8pu 54Dpp5KqJzBuMSeFPKKLconc/z1ZhBqDL9ZLx3mtoc3uJRiI2r98NtbszhAphv/HvkHo 2NuZs8p/DGMi7THI5RKhzORbjkZaf3qw+RJJC7v60SWA0mGg/a0cLIALbesKleOYzt24 71EA== X-Gm-Message-State: AD7BkJJCFcLLUJzyp77yONLC1PRWEx0iVuJ1nJngwtqwrOxkkZxPdCvY5pUyxJ/kvUnaucegJ0lYl6z3kGt8+Q== MIME-Version: 1.0 X-Received: by 10.13.223.15 with SMTP id i15mr5891548ywe.280.1458847019070; Thu, 24 Mar 2016 12:16:59 -0700 (PDT) Received: by 10.129.148.70 with HTTP; Thu, 24 Mar 2016 12:16:58 -0700 (PDT) In-Reply-To: References: Date: Thu, 24 Mar 2016 20:16:58 +0100 Message-ID: To: Sara Golemon Cc: "Colin O'Dell" , PHP internals Content-Type: multipart/alternative; boundary=001a114e52605a7872052ed04a5e Subject: Re: [PHP-DEV] Add spaceship assignment operator From: nikita.ppv@gmail.com (Nikita Popov) --001a114e52605a7872052ed04a5e Content-Type: text/plain; charset=UTF-8 On Thu, Mar 24, 2016 at 8:05 PM, Sara Golemon wrote: > On Thu, Mar 24, 2016 at 11:50 AM, Colin O'Dell > wrote: > > Would your proposal also allow !==== to work? > > > I think you means !===, which is "not-identical assignment" (!== =) > > !==== is just *CRAZY TALK* > We shouldn't dismiss such things out of hand, Sara. Consider the following argument: There is a binary !== operator. The compound assignment version of it is !===. But that again is a binary operator! So there should be a !==== compound assignment operator as well. By induction over the natural numbers it follows that !== followed by an arbitrary number of =s should be a valid compound assignment operator. However, when considering the expansion, we see: $a !==== $b; // same as $a = $a !=== $b; // same as $a = $a = $a !== $b; It is now evident that $a !==== $b (or any additional number of =s) has the same meaning as $a !=== $b. A difference could only arise if the left-hand side is an object implementing __set or ArrayAccess, in which case !==== would cause an additional call to __set / offsetSet. Given that !==== and !=== would be, apart from the edge-case of overloaded objects, identical, I must concur with your original judgement that only supporting !=== is sufficient. Thanks, Nikita --001a114e52605a7872052ed04a5e--