Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:91915 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 46981 invoked from network); 24 Mar 2016 18:33:42 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Mar 2016 18:33:42 -0000 Authentication-Results: pb1.pair.com smtp.mail=derokorian@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=derokorian@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.214.173 as permitted sender) X-PHP-List-Original-Sender: derokorian@gmail.com X-Host-Fingerprint: 209.85.214.173 mail-ob0-f173.google.com Received: from [209.85.214.173] ([209.85.214.173:36709] helo=mail-ob0-f173.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 46/E5-15440-60334F65 for ; Thu, 24 Mar 2016 13:33:42 -0500 Received: by mail-ob0-f173.google.com with SMTP id m7so44248965obh.3 for ; Thu, 24 Mar 2016 11:33:42 -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=fVY16MRuLvjGxQzpj2ql1LHxwmRqdvZNH5XkupJtdj8=; b=zQGdkGwpa1NZfbT9MzCVAKBTjDB9jfmccMRYibLZpZo752Q8NIgihpwDZiq3SwfOXt K5hiRHZdclIbTxCWecCALPuKVm7oM6qoCq0j164fQnFHCwq5dQpMiv8N4g34YjidNfaR cH1IIEUxTZzYfxGKXjX5D7AcNRsWcS8apIYVN18dBv5+11J2xfhvWuyJc17PfxNDhJCR KrZBpl9ejCmjsDZ24YTBsxZh++o2a57rzmagIZtPwjU9vMZ3S0KsymeZggXKduOw7/wY f7qA7vUJ8i+pXNPKw/8yWtT7aL2XjulKgxm3neMkHXur2b9RAsMOXxFo/Eu8HvI2Od4B e4cg== 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=fVY16MRuLvjGxQzpj2ql1LHxwmRqdvZNH5XkupJtdj8=; b=IxRuh+0LN4PRSvgBC0sKFRoD2v7/1XFXX7aKLthAKTr6ZbKp6UUWcN5ahfHlJcwMWz JaAI+yJoIYLoihoW4e1JnJgWGVVcWhUxyWNdGpj7X1GV7UxqAnbjhcn9rk5mHmh/Uoya bs1QoaejnwSUZK/3Ky4uleC8UxtUPVVPKSU8NYXaHULX7Wj9JQ9noKMyAHd8K+NYe4Nh FTk5GzgnlD7MbDvsU5dY3gjjZ4Dxc8k15/yM0eghpwLG1EzttlW78TsVGqVGhg8rNobl UkvtWWD5cgxkMQtWBDuRIRT1JBPFduvVGn+kZ9WtxTi8WmNaTzvEBOBk8YyoY+nCESE8 WLGQ== X-Gm-Message-State: AD7BkJIJPo7necndyVwJQzo8qxQGwJrSbgeNd2N4xeJmA22Kh+yZHG/S9Ybl2eGL1nvkgtQVvmI4GuYjJZ/y+A== MIME-Version: 1.0 X-Received: by 10.60.119.39 with SMTP id kr7mr5070489oeb.34.1458844419126; Thu, 24 Mar 2016 11:33:39 -0700 (PDT) Received: by 10.157.4.200 with HTTP; Thu, 24 Mar 2016 11:33:39 -0700 (PDT) In-Reply-To: References: Date: Thu, 24 Mar 2016 12:33:39 -0600 Message-ID: To: Nikita Popov Cc: PHP internals Content-Type: multipart/alternative; boundary=047d7b33d03462a6c7052ecfaf0b Subject: Re: [PHP-DEV] Add spaceship assignment operator From: derokorian@gmail.com (Ryan Pallas) --047d7b33d03462a6c7052ecfaf0b Content-Type: text/plain; charset=UTF-8 Hi Nikita, On Thu, Mar 24, 2016 at 11:50 AM, Nikita Popov wrote: > Hi internals! > > For consistency, we should add a spaceship assignment operator: > > $a <=>= $b; > // same as > $a = ($a <=> $b); > I'm not sure I see a use case for this, when do you compare 2 values and replace one of those values with the result of the comparison? I've literally never done that. > > Additionally, we should add an is-identical assignment operator: > > $a ==== $b; > // same as > $a = ($a === $b); > Again, why would you do this? How often are you replacing the contents of a variable with the results of comparing it with something else? $c = $a === $b; $c = $a <=> $b; That seems to be far more common if assigning the results to a variable at all (which is itself not that common for comparisons in my experience). > > Thank you for taking this proposal under consideration. > > Regards, > Nikita > Thanks for bringing this up, but I don't see the consistency argument, and I don't feel like its normal use cases at all. --047d7b33d03462a6c7052ecfaf0b--