Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:11052 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 39463 invoked by uid 1010); 10 Jul 2004 00:00:50 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 39358 invoked from network); 10 Jul 2004 00:00:49 -0000 Received: from unknown (HELO mx.thebrainroom.net) (69.55.226.195) by pb1.pair.com with SMTP; 10 Jul 2004 00:00:49 -0000 Received: by mx.thebrainroom.net (Postfix, from userid 517) id 68FEC1488035; Fri, 9 Jul 2004 17:00:49 -0700 (PDT) Received: from BAUMBART (p508EAFD4.dip.t-dialin.net [80.142.175.212]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by mx.thebrainroom.net (Postfix) with ESMTP id 5029E1488033; Fri, 9 Jul 2004 17:00:47 -0700 (PDT) Date: Sat, 10 Jul 2004 02:00:55 +0200 Reply-To: Marcus Boerger X-Priority: 3 (Normal) Message-ID: <1242942781.20040710020055@marcus-boerger.de> To: John Lim Cc: internals@lists.php.net In-Reply-To: <20040709164211.36463.qmail@pb1.pair.com> References: <5.1.0.14.0.20040707203931.02fa6200@mail.ionzoft.com> <40ED64A0.7050305@cschneid.com> <20040708151952.92187.qmail@pb1.pair.com> <20040708215205.23281.qmail@pb1.pair.com> <20040708222005.4329.qmail@pb1.pair.com> <20040708233326.73283.qmail@pb1.pair.com> <20040708235341.42767.qmail@pb1.pair.com> <007201c4655d$283125d0$6601a8c0@calhoun> <20040709164211.36463.qmail@pb1.pair.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on jc.thebrainroom.net X-Spam-Status: No, hits=0.8 required=5.0 tests=HTML_MESSAGE,PRIORITY_NO_NAME autolearn=no version=2.63 X-Spam-Level: X-TBR-Filter: Virus scanned and defanged Subject: Re: [PHP-DEV] what happened to that new isset() like language From: helly@php.net (Marcus Boerger) Hello John, we are not testing against NULL here. We check for existance. That would be having a uniform sql way to test the existance of a table or column in a table. Hence IFNULL(), NOT IFNULL(), NVL() are different. I also explained several times why coalesce doesn't apply. Friday, July 9, 2004, 6:42:10 PM, you wrote: > Hi, > I would suggest another name for ifsetor. > In relational databases, there is a similar function, called NVL in oracle, > and IFNULL in MySQL and coalesce in postgresql for testing for null, and > returning a default value if the variable is null. > I think ifsetor sounds a big ugly. I would suggest ifset($var, > $defaultvalue), as there are historical analogies with mysql's > IFNULL function, and i think ifset looks different enough from > isset, thanks to the tall 'F'. read top...IFNULL === is_null which has nothing to do with isset() > $var = isset($aval) ? $aval : 0; > $var = ifset($aval, 0); That suggests it returns 0 if $val is set and not what you describe above. To explain why i chose "ifsetor" try to read it as: "if" "set" return it "or" return regards marcus