Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:51919 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 47783 invoked from network); 16 Apr 2011 23:10:41 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Apr 2011 23:10:41 -0000 Authentication-Results: pb1.pair.com header.from=keisial@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=keisial@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.54 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: keisial@gmail.com X-Host-Fingerprint: 74.125.82.54 mail-ww0-f54.google.com Received: from [74.125.82.54] ([74.125.82.54:61657] helo=mail-ww0-f54.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id CC/F5-01786-0F12AAD4 for ; Sat, 16 Apr 2011 19:10:41 -0400 Received: by wwd20 with SMTP id 20so4425279wwd.11 for ; Sat, 16 Apr 2011 16:10:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=8q9DFAEj1tUk8h4cWy2u967Jvf6iKUFyeEXplV/2w6k=; b=XN2YWHxSym4fKxZwCIwIhLdjuZlZsquOVwDXu1UEN9F7tnZ6Fhrj41AIHMsRMxC287 eFm0d7lVwWdYn6JD4u2L+DeT7a9DsSWFmrIQWe0BY7H2y9g4uZQUbnp3ailUaUPoFjab 1HNz+FW8B/yUSwASVoyWuu4gNAlUvouD/VAfU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; b=cLUjuFtvR1OJOxX16YGDL+9+dbDbiEHF51rN7r85TzUUwqm2pDuoIxM0UJOdUIhYgU rkrDs5aDoybemTy+l3chf/4SJeurNpec+hAZdNZCj9phcwTK9V3ef8Nxoym6y1WgDPlI e1X+az1iGmowhVK8tmbZtGjFIji3eCw+VZTWE= Received: by 10.227.59.210 with SMTP id m18mr3412947wbh.112.1302995437067; Sat, 16 Apr 2011 16:10:37 -0700 (PDT) Received: from [192.168.1.26] (199.Red-83-55-230.dynamicIP.rima-tde.net [83.55.230.199]) by mx.google.com with ESMTPS id b20sm2399254wbb.33.2011.04.16.16.10.34 (version=SSLv3 cipher=OTHER); Sat, 16 Apr 2011 16:10:35 -0700 (PDT) Message-ID: <4DAA22EF.9060202@gmail.com> Date: Sun, 17 Apr 2011 01:14:55 +0200 User-Agent: Thunderbird MIME-Version: 1.0 To: Ben Schmidt CC: Adam Richardson , PHP Development References: <718216446.20110408143441@cypressintegrated.com> <4DA0E71C.9030008@gmail.com> <4DA63ED8.4080402@yahoo.com.au> <4DA6F2BC.10706@yahoo.com.au> <4DA6FB03.9040404@yahoo.com.au> <4DA8E6D9.5080107@yahoo.com.au> <4DA98D34.1020909@yahoo.com.au> <4DA98E17.6080409@yahoo.com.au> In-Reply-To: <4DA98E17.6080409@yahoo.com.au> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Implicit isset/isempty check on short-ternary operator From: keisial@gmail.com ("=?ISO-8859-1?Q?=C1ngel_Gonz=E1lez?=") Ben Schmidt wrote: >>> $var = $arr['key'] ?? : 'empty'; > > Also note this is possible with the recent proposal Hannes and I were > discussing. It simply looks like > > $var = $arr?['key'] ?: 'empty'; > > The ?[ avoids notices and the ?: works as it always has. > > Ben. If it was going to be ?[, I'd much prefer $arr['key'?]. It was proposed as $arr[?'key'] instead to avoid a backtracking (would that really be noticeable? I'd prefer readibility), but ?[ would have the same problem.