Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:77281 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 66652 invoked from network); 17 Sep 2014 08:58:37 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Sep 2014 08:58:37 -0000 Authentication-Results: pb1.pair.com header.from=php@golemon.com; sender-id=softfail Authentication-Results: pb1.pair.com smtp.mail=php@golemon.com; spf=softfail; sender-id=softfail Received-SPF: softfail (pb1.pair.com: domain golemon.com does not designate 209.85.220.44 as permitted sender) X-PHP-List-Original-Sender: php@golemon.com X-Host-Fingerprint: 209.85.220.44 mail-pa0-f44.google.com Received: from [209.85.220.44] ([209.85.220.44:51747] helo=mail-pa0-f44.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 04/81-57031-C3D49145 for ; Wed, 17 Sep 2014 04:58:37 -0400 Received: by mail-pa0-f44.google.com with SMTP id kx10so1756796pab.31 for ; Wed, 17 Sep 2014 01:58:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:content-type:mime-version:subject:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to; bh=UEGvn6JPIvgk/+ny49eZlQL3m6v7SBV1bLrOqWtUwWA=; b=dcPa6+S2tXs9F+5RrxAqzr59jkbmYI/Tn0cV9qF0L1ZpARFk7NFC2cWH/ZXZZeIbJu e826Ol6lCrqr/FZ294nG6nBtnK1tzjqClDEoOYW3OTZdoj/7amzyjJVRWVG3xGRD5TKM OC4HVKcvCbsSJIJXEP3O67McPfFc8XM33uEPuuJCQpYqew5CX89okXkHZJKIInV8swch pt1Vu3/awl0Ll5/47yVJRGQOQz4zkfkSknbW1KStcuWchtVjYdhV4hMmixm1cyqDAUKb PZ3WdoD82/OFJcNRarsxI32o009/Q0iwkiR6IkUuPKe/mbYGPzu4UvQiN+zvZzFZ4fT4 vN4Q== X-Gm-Message-State: ALoCoQn/mUCQEFA+V3YRWsGXlbB6rKjOJAZIzAsO3Z5Teh2AubX4jeiEkjn3x2ELHweHo2+90X2G X-Received: by 10.68.164.35 with SMTP id yn3mr58437779pbb.104.1410944313781; Wed, 17 Sep 2014 01:58:33 -0700 (PDT) Received: from [10.0.1.108] (c-71-198-113-183.hsd1.ca.comcast.net. [71.198.113.183]) by mx.google.com with ESMTPSA id a1sm1489377pdc.68.2014.09.17.01.58.33 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 17 Sep 2014 01:58:33 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) X-Mailer: iPhone Mail (11D201) In-Reply-To: Date: Wed, 17 Sep 2014 01:58:32 -0700 Cc: Christoph Becker , Andrea Faulds , Adam Harvey , PHP internals Content-Transfer-Encoding: quoted-printable Message-ID: <15567763-3134-43D5-8567-24841C6E831C@golemon.com> References: <540D638B.8010303@php.net> <24B60FB5-35B8-4B6F-AD6C-54A8B24D4462@ajf.me> <540DC38B.3070700@gmx.de> <324F7C72-BC72-4109-941E-BA2947EFA4E7@ajf.me> <0D0523A9-088B-4923-BA21-22F560E18013@ajf.me> <541896CF.50000@gmx.de> To: "Kingsquare.nl - Robin Speekenbrink" Subject: Re: [PHP-DEV] [RFC] Implicit isset() in Shorthand Ternary Operator From: php@golemon.com (Sara Golemon) > On Sep 16, 2014, at 13:46, "Kingsquare.nl - Robin Speekenbrink" wrote: >=20 > As a userland point of view on this: will this have a shorthand? i.e. > what will happen if i leave out the second part? >=20 > ie. > $var =3D $_GET['test'] ?? ; >=20 > would that be the same as > $var =3D @$_GET['test']; >=20 > The RFC isnt clear in this regard (or that the righthand side of the > operator _is_ required... maybe it's me ? >=20 The equivalent of your error suppressed example would be: $var =3D $_GET['test'] ?? null; I don't think it gains anyone much to have another form just to save four ch= aracters (for the default `null`). Someone mentioned an assignment version which isn't covered in niki's patch b= ut would be a fairly trivial addition. $var ??=3D expr; Which essentially means: if (!isset($var)) { $var =3D expr; } I'd kinda like that for completeness, but will vote for this with or without= the assignment version. -Sara=