Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:34946 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 35197 invoked by uid 1010); 26 Jan 2008 21:23:50 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 35182 invoked from network); 26 Jan 2008 21:23:50 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Jan 2008 21:23:50 -0000 Authentication-Results: pb1.pair.com smtp.mail=robert@interjinn.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=robert@interjinn.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain interjinn.com from 66.11.173.122 cause and error) X-PHP-List-Original-Sender: robert@interjinn.com X-Host-Fingerprint: 66.11.173.122 unknown Received: from [66.11.173.122] ([66.11.173.122:24717] helo=interjinn.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 34/15-08850-4E4AB974 for ; Sat, 26 Jan 2008 16:23:50 -0500 Received: from [192.168.1.3] (blobule.suds [192.168.1.3]) by interjinn.com (Postfix) with ESMTP id D390311FB6D; Sat, 26 Jan 2008 16:23:45 -0500 (EST) To: Lars Strojny Cc: internals Mailing List In-Reply-To: <1201382016.28545.7.camel@localhost> References: <1201367844.8418.4.camel@sams-room> <1201382016.28545.7.camel@localhost> Content-Type: text/plain Organization: InterJinn Date: Sat, 26 Jan 2008 16:23:51 -0500 Message-ID: <1201382631.6333.201.camel@blobule> Mime-Version: 1.0 X-Mailer: Evolution 2.12.1 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] ifsetor like expression in php6 From: robert@interjinn.com (Robert Cummings) On Sat, 2008-01-26 at 22:13 +0100, Lars Strojny wrote: > Hi, > > Am Samstag, den 26.01.2008, 12:17 -0500 schrieb Sam Barrow: > > I don't think throwing a E_NOTICE is appropriate. The isset() construct > > doesn't throw an E_NOTICE, this shouldn't either. > > As far as I understand it is just an extension to the already present > tertiary operator and therefore the ifsetor would be > isset($_GET['foo']) ?: 'bar'. This doesn't work how you think... if $_GET['foo'] is set then the return value is true and not the value of $_GET['foo']. > I don't understand why that sugar should > act anything different and not trigger an E_NOTICE. I thought it was supposed to be a shortcut for doing the following: $foo = isset( $_GET['foo'] ) ? $_GET['foo'] : 'xyz'; 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? Cheers, Rob. -- .------------------------------------------------------------. | InterJinn Application Framework - http://www.interjinn.com | :------------------------------------------------------------: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `------------------------------------------------------------'