Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:3964 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 821 invoked from network); 14 Aug 2003 20:41:09 -0000 Received: from unknown (HELO pd4mo2so.prod.shaw.ca) (24.71.223.10) by pb1.pair.com with SMTP; 14 Aug 2003 20:41:09 -0000 Received: from pd5mr4so.prod.shaw.ca (pd5mr4so-qfe3.prod.shaw.ca [10.0.141.168]) by l-daemon (iPlanet Messaging Server 5.2 HotFix 1.16 (built May 14 2003)) with ESMTP id <0HJM00118MKR18@l-daemon> for internals@lists.php.net; Thu, 14 Aug 2003 14:36:27 -0600 (MDT) Received: from pn2ml9so.prod.shaw.ca (pn2ml9so-qfe0.prod.shaw.ca [10.0.121.7]) by l-daemon (iPlanet Messaging Server 5.2 HotFix 1.16 (built May 14 2003)) with ESMTP id <0HJM00L3GMKRYE@l-daemon> for internals@lists.php.net; Thu, 14 Aug 2003 14:36:27 -0600 (MDT) Received: from h24-84-221-8.vc.shawcable.net (h24-84-221-8.vc.shawcable.net [24.84.221.8]) by l-daemon (iPlanet Messaging Server 5.2 HotFix 1.16 (built May 14 2003)) with ESMTP id <0HJM00LCVMKQS9@l-daemon> for internals@lists.php.net; Thu, 14 Aug 2003 14:36:27 -0600 (MDT) Date: Thu, 14 Aug 2003 13:35:54 -0700 In-reply-to: To: walt boring Cc: PHP Developers Mailing List Message-ID: <1060893354.3102.101.camel@ali> Organization: MIME-version: 1.0 X-Mailer: Ximian Evolution 1.2.4 Content-type: text/plain Content-transfer-encoding: 7BIT References: <1060813541.901.336.camel@ali> <1060886610.50229.9.camel@localhost> <3F3BDEEE.4000106@3gstech.com> <200308141530.20653.ilia@prohost.org> <3F3BE47A.9060303@3gstech.com> Subject: Re: [PHP-DEV] Re: variable_exists() patch From: torben@php.net (Lars Torben Wilson) On Thu, 2003-08-14 at 12:41, Derick Rethans wrote: > On Thu, 14 Aug 2003, walt boring wrote: > > > Then please explain the logic of why > > $var = null > > > > isset($var) returns false. > > > > In your words "it will see if a variable is set (has a value)". > > > > $var IS set and DOES have a value, it just happens to be a value of null. > > I've done a fair deal of PHP programming and I never had the need to do > this... What use do you have for a variable with the value NULL? > > Derick Well, one might use it to represent a NULL value, much like we do with dbs. I imagine that they had a reason for giving us a way to work with NULL. Otherwise we'd just destroy the variable and be done with it. Here's one thing: it's more straightforward to do if (variable_exists($arr[1][2][4])) {. . .} than if (array_key_exists(4, $arr[1][2]) {. . .} ...especically since array_key_exists() will start spewing notices if any subarray in the array you pass in does not exist. You can work around it, but then the chain of workarounds to handle something many would argue should be basic functionality gets a little over-the-top. -- Torben Wilson +1.604.709.0506 http://www.thebuttlesschaps.com http://www.inflatableeye.com http://www.hybrid17.com http://www.themainonmain.com -----==== Boycott Starbucks! http://www.haidabuckscafe.com ====-----