Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:51828 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 57122 invoked from network); 7 Apr 2011 22:03:55 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 7 Apr 2011 22:03:55 -0000 Authentication-Results: pb1.pair.com smtp.mail=rasmus@lerdorf.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=rasmus@lerdorf.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain lerdorf.com from 209.85.218.42 cause and error) X-PHP-List-Original-Sender: rasmus@lerdorf.com X-Host-Fingerprint: 209.85.218.42 mail-yi0-f42.google.com Received: from [209.85.218.42] ([209.85.218.42:58525] helo=mail-yi0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 14/D2-36433-AC43E9D4 for ; Thu, 07 Apr 2011 18:03:54 -0400 Received: by yib12 with SMTP id 12so1453625yib.29 for ; Thu, 07 Apr 2011 15:03:51 -0700 (PDT) Received: by 10.101.93.19 with SMTP id v19mr951454anl.60.1302213831538; Thu, 07 Apr 2011 15:03:51 -0700 (PDT) Received: from itsupports-MacBook-Pro-2.local (66-162-68-162.static.twtelecom.net [66.162.68.162]) by mx.google.com with ESMTPS id b28sm2226617anb.22.2011.04.07.15.03.49 (version=SSLv3 cipher=OTHER); Thu, 07 Apr 2011 15:03:50 -0700 (PDT) Message-ID: <4D9E34C4.5000406@lerdorf.com> Date: Thu, 07 Apr 2011 18:03:48 -0400 User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.15) Gecko/20110303 Thunderbird/3.1.9 MIME-Version: 1.0 To: Matthew Weier O'Phinney CC: internals@lists.php.net References: <4D950434.3060704@yahoo.com.au> <4D9E0543.1080600@lerdorf.com> <69.82.36433.EC33E9D4@pb1.pair.com> In-Reply-To: <69.82.36433.EC33E9D4@pb1.pair.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Implicit isset/isempty check on short-ternary operator From: rasmus@lerdorf.com (Rasmus Lerdorf) On 4/7/11 5:59 PM, Matthew Weier O'Phinney wrote: > It may change the semantics as they stand, but I'd argue that the > _expectation_ from the shorthand ternary is to shorten code that > currently uses isset(). As it is, I have almost no use for it at this > point, as I end up needing to do: > > $value = isset($a[$key]) ? $a[$key] : 'Not set'; > > which is exactly the situation I had before it was introduced. Not sure why you would have that expectation. The long ternary doesn't do that, and there is nothing about the short ternary that changes that. There was talk of a new ifsetor type of operator to have those semantics but never any talk of changing existing semantics. -Rasmus