Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:51830 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 62041 invoked from network); 7 Apr 2011 22:36:50 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 7 Apr 2011 22:36:50 -0000 Authentication-Results: pb1.pair.com header.from=colder@php.net; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=colder@php.net; spf=unknown; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain php.net does not designate 94.103.100.39 as permitted sender) X-PHP-List-Original-Sender: colder@php.net X-Host-Fingerprint: 94.103.100.39 mailer.immomigsa.ch Linux 2.6 Received: from [94.103.100.39] ([94.103.100.39:39192] helo=mailer.immomigsa.ch) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 2D/93-36433-08C3E9D4 for ; Thu, 07 Apr 2011 18:36:49 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by mailer.immomigsa.ch (Postfix) with ESMTP id 7CD154B628D6; Fri, 8 Apr 2011 00:36:44 +0200 (CEST) X-Virus-Scanned: amavisd-new at immomigsa.ch Received: from mailer.immomigsa.ch ([127.0.0.1]) by localhost (mailer.immomigsa.ch [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id gV2BobUqZYOz; Fri, 8 Apr 2011 00:36:44 +0200 (CEST) Received: from crousti (46-126-188-75.dynamic.hispeed.ch [46.126.188.75]) by mailer.immomigsa.ch (Postfix) with ESMTPSA id 0644F4B60CD5; Fri, 8 Apr 2011 00:36:42 +0200 (CEST) Received: by crousti (sSMTP sendmail emulation); Fri, 08 Apr 2011 00:35:26 +0200 Date: Fri, 8 Apr 2011 00:35:26 +0200 To: Rasmus Lerdorf Cc: Matthew Weier O'Phinney , internals@lists.php.net Message-ID: <20110407223526.GJ7113@crousti> References: <4D950434.3060704@yahoo.com.au> <4D9E0543.1080600@lerdorf.com> <69.82.36433.EC33E9D4@pb1.pair.com> <4D9E34C4.5000406@lerdorf.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4D9E34C4.5000406@lerdorf.com> User-Agent: Mutt/1.5.20 (2009-06-14) Subject: Re: [PHP-DEV] Implicit isset/isempty check on short-ternary operator From: colder@php.net (Etienne Kneuss) On Apr 07 18:03:48, Rasmus Lerdorf wrote: > 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. Well it could (and I believe that was the intention) call !empty instead of isset, that way the semantics would not be changed, appart from the lack of error for undefined variables. Best, > > -Rasmus > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php >