Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:19839 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 18218 invoked by uid 1010); 29 Oct 2005 23:52:27 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 18203 invoked from network); 29 Oct 2005 23:52:27 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 29 Oct 2005 23:52:27 -0000 X-Host-Fingerprint: 81.169.182.136 ajaxatwork.net Linux 2.4/2.6 Received: from ([81.169.182.136:34630] helo=strato.aixcept.de) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id 83/44-02082-A3B04634 for ; Sat, 29 Oct 2005 19:52:26 -0400 Received: from [192.168.1.3] (dslb-084-063-026-168.pools.arcor-ip.net [84.63.26.168]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by strato.aixcept.de (Postfix) with ESMTP id 6452C610282; Sun, 30 Oct 2005 01:55:49 +0200 (CEST) Date: Sun, 30 Oct 2005 01:52:37 +0200 Reply-To: Marcus Boerger X-Priority: 3 (Normal) Message-ID: <101249249.20051030015237@marcus-boerger.de> To: Edin Kadribasic Cc: internals@lists.php.net In-Reply-To: <4364035D.5020405@emini.dk> References: <4362C5F4.8090004@safesearching.com> <4e36d31d0510281848r11118745jc65e412715690485@mail.gmail.com> <4364035D.5020405@emini.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] what happened to that new isset() like language From: helly@php.net (Marcus Boerger) Hello Edin, on the other hand it is not doable....not without a major slowdown. Thus the idea of ifsetor($var, ). Why the hell do we need to discuss this over and over again? The only way is this version. Be it with some cryptic operator like '?:' or some function name like 'ifsetor'. Either way our internals and the use of compiler compiler tools do not allow other stuff. And speaking of '?:' we turned that down because it does suggest '$a ? $a : ' which is different from the functionality we actually want: 'isset($a) ? $a : '. And actually 'ifsetor' was only turned down because someone very very hard tried to find a way to turn it down and could only come up with saying its name is bad. Which i obviously absolutley disagree since its name is perfectly clear and does not lead to confusion. Becuase it suggests something like "IF something isSET than take it OR use the other". regards marcus Sunday, October 30, 2005, 1:18:53 AM, you wrote: > 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 >> Best regards, Marcus