Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:77105 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 72116 invoked from network); 8 Sep 2014 22:58:28 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 8 Sep 2014 22:58:28 -0000 Authentication-Results: pb1.pair.com header.from=adam@adamharvey.name; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=adam@adamharvey.name; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain adamharvey.name designates 209.85.223.177 as permitted sender) X-PHP-List-Original-Sender: adam@adamharvey.name X-Host-Fingerprint: 209.85.223.177 mail-ie0-f177.google.com Received: from [209.85.223.177] ([209.85.223.177:39267] helo=mail-ie0-f177.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 97/A0-63248-E843E045 for ; Mon, 08 Sep 2014 18:58:27 -0400 Received: by mail-ie0-f177.google.com with SMTP id at20so6239497iec.22 for ; Mon, 08 Sep 2014 15:58:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adamharvey.name; s=google; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type:content-transfer-encoding; bh=aWpj+KIX3nLg1cPKffTWa4VUkr8ufZFq6mZa0pPu71Y=; b=WtiUSBReXsmY3Ab1GPW4Iqy0YUoHMX5Eg7GEbM9MsCaNErQO3kTDr7AP9BpMByMz/N DN7VKSYpwXBConOrK2JEqlwTKToChw4T4bxVtM+WAeoWhvp+kpoC9WqhWp4YT4Dc0RBx hGV+ND9Eu39HamUfYn/FPNGB5DEubPrvNVfJM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=aWpj+KIX3nLg1cPKffTWa4VUkr8ufZFq6mZa0pPu71Y=; b=Hetlf1mIMRkeIgT/XrZamtaHjtAK3X6tcJ+esJT6L6B54kqyFz7Hiy4aVrCGeHVpsG jEP3ccpDmkciMclYNL7rEi7wY7ecWKfOqbX5HNJfMmjyjRhv0R3mRgAY0LUF/XSmkpXp iiPFlGe1paEfcl8okW+XpOa8JlRdDGdl79BeVZou/LtecP3RAhz88kLeVdU843t3YbYo vM4P3BcHwJU0x6aUtJuIkPzr39rggsEa/uWbBfNm2oiS4FGDPm231oUM71m2t4jf4Gec od6kYvTK12+9gdk4FBwRxJufj+xSPhnlWPucEMbAyzJI5YpIVm3Dh0xeSTYVO0dJSUGD cn0g== X-Gm-Message-State: ALoCoQle3G3tE8IDWTT9sjWP0xVm4rfP6ZvVRqV8WVFJl5kETljyIBjXhGw6c8XuNIA52d/WxUDJ X-Received: by 10.43.98.68 with SMTP id cn4mr34990678icc.40.1410217100207; Mon, 08 Sep 2014 15:58:20 -0700 (PDT) MIME-Version: 1.0 Sender: adam@adamharvey.name Received: by 10.43.70.143 with HTTP; Mon, 8 Sep 2014 15:58:00 -0700 (PDT) In-Reply-To: <540DC38B.3070700@gmx.de> References: <540D638B.8010303@php.net> <24B60FB5-35B8-4B6F-AD6C-54A8B24D4462@ajf.me> <540DC38B.3070700@gmx.de> Date: Mon, 8 Sep 2014 15:58:00 -0700 X-Google-Sender-Auth: oz8J4_WtezJD6pPwD3LkrwF_cdE Message-ID: To: Christoph Becker Cc: Andrea Faulds , PHP internals Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] [RFC] Implicit isset() in Shorthand Ternary Operator From: aharvey@php.net (Adam Harvey) On 8 September 2014 07:56, Christoph Becker wrote: > Am 08.09.2014 15:58, schrieb Andrea Faulds: >> We could add such an operator, perhaps with the ?? syntax. However, I >> don=E2=80=99t really like the idea. It=E2=80=99s too similar to ?: so I = don=E2=80=99t think >> it=E2=80=99d be accepted, and even if it was, I=E2=80=99m not sure we re= ally need >> another operator. I=E2=80=99d much rather just make ?: do what, IMO, is = the >> right thing and what it always should have done. > > I'd rather had a shortcut for the following: > > isset($_GET['foo']) ? $_GET['foo'] : BAR Agreed. That's what ifsetor requests have generally boiled down to over the years, so it seems to be what the masses want. It's what _I_ want, anyway. :) > Of course, it is not possible to change the ?: operator to work this way > for BC reasons, but a new operator such as ?? might make sense. +1 on ?? =E2=80=94 there's precedent for it, and it means we don't have to explain why the shorthand form of an operator behaves differently to the long form, which is just going to confuse users. Adam