Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:19861 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 22973 invoked by uid 1010); 31 Oct 2005 16:29:47 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 22958 invoked from network); 31 Oct 2005 16:29:47 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 31 Oct 2005 16:29:47 -0000 X-Host-Fingerprint: 66.249.82.205 xproxy.gmail.com Linux 2.4/2.6 Received: from ([66.249.82.205:13373] helo=xproxy.gmail.com) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id D5/8B-02082-97646634 for ; Mon, 31 Oct 2005 11:29:45 -0500 Received: by xproxy.gmail.com with SMTP id s7so588029wxc for ; Mon, 31 Oct 2005 08:29:42 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=iCHFUSvJJmW223TIbCXAzcHh6ZiC+CtP9tUBHHrWIEPcpqoOWXjh4OPrnuoOvFG7dqH16PsHWTWStZGw11ix+5e/11yq9mKmGFM8y/teQHdXAcrhGOZjIly1EPQiA4EndBoRJSOFL7vkQDpRzKOb9HwqewMhHvQpHeTvhi6MknA= Received: by 10.65.73.6 with SMTP id a6mr311852qbl; Mon, 31 Oct 2005 08:29:42 -0800 (PST) Received: by 10.64.183.1 with HTTP; Mon, 31 Oct 2005 08:29:41 -0800 (PST) Message-ID: <4e36d31d0510310829h1b430963yc47dc3f4986922e8@mail.gmail.com> Date: Mon, 31 Oct 2005 08:29:41 -0800 To: "Ford, Mike" Cc: internals@lists.php.net In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: Subject: Re: [PHP-DEV] what happened to that new isset() like language From: buddhahead@gmail.com (Sebastian) What about a similar construct for checking truth? eg, $foo =3D first_true($bar, $baz, $bang); returns the value of the first variable that passes the if(isset($var) && !empty($var)) test. On 10/31/05, Ford, Mike wrote: > On 29 October 2005 22:56, Greg Beaver wrote: > > > For an operation as complicated as "use the first variable > > that exists" > > I would be most comfortable with: > > > > $d =3D first-existing: $a, $b, $c; > > That's a horrible syntax, but a fantastic name for a language construct t= o do the job. Even better might be (something like) first_isset($a, $b, $c= ) which tells you precisely what's happening: you get the first value that = passes the isset() test. > > I also find the ?? / ??=3D suggestion very attractive - it would have bee= n my suggestion for a suitable operator. > > Cheers! > > Mike > > --------------------------------------------------------------------- > Mike Ford, Electronic Information Services Adviser, > Learning Support Services, Learning & Information Services, > JG125, James Graham Building, Leeds Metropolitan University, > Headingley Campus, LEEDS, LS6 3QS, United Kingdom > Email: m.ford@leedsmet.ac.uk > Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 > > > To view the terms under which this email is distributed, please go to htt= p://disclaimer.leedsmet.ac.uk/email.htm > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > -- ------------- buddhahead@gmail.com