Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:34947 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 38508 invoked by uid 1010); 26 Jan 2008 21:44:02 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 38493 invoked from network); 26 Jan 2008 21:44:02 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Jan 2008 21:44:02 -0000 Authentication-Results: pb1.pair.com header.from=johannes@php.net; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=johannes@php.net; spf=unknown; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain php.net does not designate 83.243.58.163 as permitted sender) X-PHP-List-Original-Sender: johannes@php.net X-Host-Fingerprint: 83.243.58.163 mail4.netbeat.de Received: from [83.243.58.163] ([83.243.58.163:43268] helo=mail4.netbeat.de) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 8B/85-08850-1A9AB974 for ; Sat, 26 Jan 2008 16:44:02 -0500 Received: (qmail 1083 invoked by uid 507); 26 Jan 2008 21:43:55 -0000 Received: from unknown (HELO ?192.168.1.102?) (postmaster%schlueters.de@82.135.80.196) by mail4.netbeat.de with ESMTPA; 26 Jan 2008 21:43:55 -0000 To: Robert Cummings Cc: Lars Strojny , internals Mailing List In-Reply-To: <1201382631.6333.201.camel@blobule> References: <1201367844.8418.4.camel@sams-room> <1201382016.28545.7.camel@localhost> <1201382631.6333.201.camel@blobule> Content-Type: text/plain Date: Sat, 26 Jan 2008 22:43:34 +0100 Message-ID: <1201383814.6897.18.camel@johannes.nop> Mime-Version: 1.0 X-Mailer: Evolution 2.12.3 (2.12.3-1.fc8) Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] ifsetor like expression in php6 From: johannes@php.net (Johannes =?ISO-8859-1?Q?Schl=FCter?=) Hi, On Sat, 2008-01-26 at 16:23 -0500, Robert Cummings wrote: > And I thought the whole point was for it to not generate a notice. Isn't > that why the name ifsetor was chosen? Since it's supposed to work like > isset() by not generating notices? This thing is not called "ifsetor". From the commit message: ?: operator [DOC] "expr1 ?: expr1" is a shortcut for: "expr1 ? expr1 : expr2" as exists in gcc and discussed some time back. Note that this is not an implementation ifsetor($var, default). While ifsetor would not generate any message for non existing variables or array indices the ternary shortcut does. Also the ternary shortcut does a boolean evaluation rather then checking for isset(). That way ther ternary shortcut can work on any expression while ifsetor can only work on variables. Also to be silent one has do do: "@$expr1 ?: $expr2". I didn't check the docs, if it is documented as "ifsetor" there that's wrong. For reasons why there is no "ifsetor" but this operator please check the archives. johannes