Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:3960 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 61276 invoked from network); 14 Aug 2003 19:58:29 -0000 Received: from unknown (HELO pd3mo2so.prod.shaw.ca) (24.71.223.10) by pb1.pair.com with SMTP; 14 Aug 2003 19:58:29 -0000 Received: from pd6mr4so.prod.shaw.ca (pd6mr4so-qfe3.prod.shaw.ca [10.0.141.219]) by l-daemon (iPlanet Messaging Server 5.2 HotFix 1.16 (built May 14 2003)) with ESMTP id <0HJM005GCKJ0V3@l-daemon> for internals@lists.php.net; Thu, 14 Aug 2003 13:52:12 -0600 (MDT) Received: from pn2ml5so.prod.shaw.ca (pn2ml5so-qfe0.prod.shaw.ca [10.0.121.149]) by l-daemon (iPlanet Messaging Server 5.2 HotFix 1.16 (built May 14 2003)) with ESMTP id <0HJM004CJKJ1LE@l-daemon> for internals@lists.php.net; Thu, 14 Aug 2003 13:52:13 -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 <0HJM0073PKIZBH@l-daemon> for internals@lists.php.net; Thu, 14 Aug 2003 13:52:13 -0600 (MDT) Date: Thu, 14 Aug 2003 12:51:39 -0700 In-reply-to: <200308141559.05609.ilia@prohost.org> To: ilia@prohost.org Cc: Robert Cummings , walt boring , Timm Friebe , internals@lists.php.net Message-ID: <1060890699.1036.76.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> <200308141530.20653.ilia@prohost.org> <1060889615.29961.11.camel@blobule.suds> <200308141559.05609.ilia@prohost.org> Subject: Re: [PHP-DEV] Re: variable_exists() patch From: torben@php.net (Lars Torben Wilson) On Thu, 2003-08-14 at 12:59, Ilia Alshanetsky wrote: > On August 14, 2003 03:33 pm, Robert Cummings wrote: > > Actually isset() doesn't behave as it should: > > > > $foo = null; > > echo isset( $foo ); > > Not quite. To understand the nature of NULL you must consider the following. > Suppose you have a variable $foo you wish to 'destroy' you can do so by doing > unset($foo) or $foo = NULL;. In both cases the value of $foo will be > destroyed, however the variable will remain, it's value will become NULL. > Therefor isset() behaviour, which works by seeing if a variable exists and > making sure that its value is not null, is correct and now flawed as you > claim. This is true for other languages as well such as C, when a pointer's > value is null that pointer is 'no set'. > > Ilia unset($foo) is not the same as $foo = NULL, which is one way this is useful: OUTPUT: $foo = null variable_exists($foo): yes (should be yes) isset($foo): no (should be yes) unset($foo); variable_exists($foo): no (should be no) isset($bar): no (should be no) -- 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 ====-----