Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:77267 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 11745 invoked from network); 16 Sep 2014 18:42:44 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Sep 2014 18:42:44 -0000 Authentication-Results: pb1.pair.com smtp.mail=ajf@ajf.me; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=ajf@ajf.me; sender-id=pass Received-SPF: pass (pb1.pair.com: domain ajf.me designates 198.187.29.245 as permitted sender) X-PHP-List-Original-Sender: ajf@ajf.me X-Host-Fingerprint: 198.187.29.245 imap11-3.ox.privateemail.com Received: from [198.187.29.245] ([198.187.29.245:42692] helo=imap11-3.ox.privateemail.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B7/27-64534-2A488145 for ; Tue, 16 Sep 2014 14:42:43 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.privateemail.com (Postfix) with ESMTP id 100878800D2; Tue, 16 Sep 2014 14:42:40 -0400 (EDT) X-Virus-Scanned: Debian amavisd-new at imap11.ox.privateemail.com Received: from mail.privateemail.com ([127.0.0.1]) by localhost (imap11.ox.privateemail.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 8HSwM9Khov0b; Tue, 16 Sep 2014 14:42:39 -0400 (EDT) Received: from oa-res-27-90.wireless.abdn.ac.uk (oa-res-27-90.wireless.abdn.ac.uk [137.50.27.90]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.privateemail.com (Postfix) with ESMTPSA id EBD688800DA; Tue, 16 Sep 2014 14:42:38 -0400 (EDT) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) In-Reply-To: Date: Tue, 16 Sep 2014 19:42:36 +0100 Cc: PHP internals Content-Transfer-Encoding: quoted-printable Message-ID: <0D0523A9-088B-4923-BA21-22F560E18013@ajf.me> References: <540D638B.8010303@php.net> <24B60FB5-35B8-4B6F-AD6C-54A8B24D4462@ajf.me> <540DC38B.3070700@gmx.de> <324F7C72-BC72-4109-941E-BA2947EFA4E7@ajf.me> To: Adam Harvey X-Mailer: Apple Mail (2.1878.6) Subject: Re: [PHP-DEV] [RFC] Implicit isset() in Shorthand Ternary Operator From: ajf@ajf.me (Andrea Faulds) On 16 Sep 2014, at 19:38, Adam Harvey wrote: > On 16 September 2014 11:34, Andrea Faulds wrote: >> By popular demand, I=92ve changed the RFC to instead propose a ?? = operator, after Nikita Popov generously donated a working ?? patch. In = doing so, the RFC is renamed =93Null Coalesce Operator=94. >>=20 >> Please read it: https://wiki.php.net/rfc/isset_ternary >=20 > Love it! Kudos to you and Nikita. >=20 > Is it possible to chain ?? operators; ie $value =3D $foo ?? $bar ?? = 'default=92? Yep: $ sapi/cli/php -r '$x =3D NULL; $y =3D NULL; $z =3D 3; var_dump($x ?? $y = ?? $z);' int(3) $ sapi/cli/php -r '$x =3D ["yarr" =3D> "meaningful_value"]; = var_dump($x["aharr"] ?? $x["waharr"] ?? $x["yarr"]);' string(16) "meaningful_value" -- Andrea Faulds http://ajf.me/