Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:43916 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 86666 invoked from network); 12 May 2009 19:35:53 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 12 May 2009 19:35:53 -0000 Authentication-Results: pb1.pair.com smtp.mail=olafurw@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=olafurw@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.219.166 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: olafurw@gmail.com X-Host-Fingerprint: 209.85.219.166 mail-ew0-f166.google.com Received: from [209.85.219.166] ([209.85.219.166:48645] helo=mail-ew0-f166.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 35/59-64369-79FC90A4 for ; Tue, 12 May 2009 15:35:52 -0400 Received: by ewy10 with SMTP id 10so180694ewy.23 for ; Tue, 12 May 2009 12:35:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=ojRPXq4KBWWaN1rAonREd2osrheVm0k7WkwAzPzgiZ4=; b=NX2R5vfoH9zjzOT5YsliJbkSsCSSDx9CUCRIzfgAVzh1MjvuQXG9SoNGtz9lHYccIN 3HPgCHvMTgtMRE+b6Ur6daunPst/xPiQJ232li892LoQM90cADxSp5Lg260vHpd5K44o 5WxId40CAdMMHLtlpEEkAZQkKPS7qIbcsugiQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=ItvAKWKCOjyBkASxkMiFF0EYOGgjVUjlQdqoV1x00c1sy6KcaggQStX+SYox4jmscc q6QUIyrrJurvUlWysw8jFHuRNjg5CiYIiFOeIds2UbmwIbiq8kkUBY6HeZHZa+nADLbh kzuA/jmbSVhLry2BzrRlZadR4zylBAIzTskyA= MIME-Version: 1.0 Received: by 10.216.0.83 with SMTP id 61mr20633wea.170.1242156948971; Tue, 12 May 2009 12:35:48 -0700 (PDT) In-Reply-To: <1242149981.10178.25.camel@localhost> References: <8c35d7690905120935t18722295i69217245c9296a6d@mail.gmail.com> <1242149981.10178.25.camel@localhost> Date: Tue, 12 May 2009 19:35:48 +0000 Message-ID: <8c35d7690905121235s6d732eedk87ff45855607fdcf@mail.gmail.com> To: internals@lists.php.net Content-Type: multipart/alternative; boundary=00163646b992b2dfb10469bc33f0 Subject: Re: [PHP-DEV] The constant use of isset() From: olafurw@gmail.com (=?ISO-8859-1?Q?=D3lafur_Waage?=) --00163646b992b2dfb10469bc33f0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit On Tue, May 12, 2009 at 5:39 PM, Robert Cummings wrote: > On Tue, 2009-05-12 at 18:23 +0100, Lewis Wright wrote: > > Regarding ifsetor, what's wrong with just using this: > > > > isset($myvar) OR $myvar = 'i am set'; > > > > It works in just the same way and has no problems. I agree it would be > > great though if there could be a function to retrieve a variable's > > value if it exists, without throwing an error if it doesn't exist. I'm > > not sure if isset would be appropriate though. > > > > Lewis. > > mixed value_of( $variable [, $defaultValue=null] ); > > > if( value_of( $_GET['action'] ) == 'edit' ) > { > // ... > } > > switch( value_of( $_GET['action'], 'details' ) ) > { > case 'details': ... > } > > ?> > > Cheers, > Rob. > -- > http://www.interjinn.com > Application and Templating Framework for PHP > > Will this run without notices if the value you are passing to the function isnt set? Olafur --00163646b992b2dfb10469bc33f0--