Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:19836 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 9517 invoked by uid 1010); 29 Oct 2005 23:18:39 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 9502 invoked from network); 29 Oct 2005 23:18:39 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 29 Oct 2005 23:18:39 -0000 X-Host-Fingerprint: 192.38.9.232 gw2.emini.dk Linux 2.4/2.6 Received: from ([192.38.9.232:8519] helo=gw2.emini.dk) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id 8A/73-02082-D4304634 for ; Sat, 29 Oct 2005 19:18:37 -0400 Received: from [10.0.0.11] (gw1.emini.dk [212.242.124.121]) by gw2.emini.dk (Postfix) with ESMTP id A115A8BA48; Sun, 30 Oct 2005 01:18:33 +0200 (CEST) Message-ID: <4364035D.5020405@emini.dk> Date: Sun, 30 Oct 2005 01:18:53 +0200 User-Agent: Thunderbird 1.4 (Windows/20050908) MIME-Version: 1.0 To: Sebastian Cc: internals@lists.php.net References: <4362C5F4.8090004@safesearching.com> <4e36d31d0510281848r11118745jc65e412715690485@mail.gmail.com> In-Reply-To: <4e36d31d0510281848r11118745jc65e412715690485@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] what happened to that new isset() like language From: edink@emini.dk (Edin Kadribasic) If we're going to add a new language construct I believe that it should be readable and not some perl-like thingie. SQL has coalesce() functions which returns returns first non-null argument of any number of arguments. PHP version could return a first set argument: $lang = coalesce($_COOKIE['lang'], $user_settings['lang'], 'en'); It shouldn't be too difficult to tell what this one does. Edin Sebastian wrote: > Wow, it'll be just like perl! this is so great. > > On 10/28/05, James Crumpton wrote: >> Andi Gutmans wrote: >> > I don't think it's a matter of giving the engine a try. I think we first need >> > to make a decision what the best way to go is and then we can discuss >> > implementation if/what is possible. Once 5.0.0 is out I'm going to have more >> > time look into this. >> >> What's the word on this? >> >> Some of the names given were: >> issetor >> ifsetor >> ifset >> ifnull >> coalesce >> >> I'm actually kind of partial to: >> >> $a = $foo || $bar; >> $a = $foo || $bar || $xyz || $etc; >> >> Or better yet (or maybe in addition too): >> >> $a['foo'] ||= 'bar'; // if set do nothing, otherwise assign 'bar' >> >> >> -james >> >> -- >> PHP Internals - PHP Runtime Development Mailing List >> To unsubscribe, visit: http://www.php.net/unsub.php >> >> > > > -- > > > > ------------- > buddhahead@gmail.com >