Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:48743 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 96441 invoked from network); 11 Jun 2010 17:43:15 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Jun 2010 17:43:15 -0000 Authentication-Results: pb1.pair.com smtp.mail=brian@moonspot.net; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=brian@moonspot.net; sender-id=pass Received-SPF: pass (pb1.pair.com: domain moonspot.net designates 72.5.90.27 as permitted sender) X-PHP-List-Original-Sender: brian@moonspot.net X-Host-Fingerprint: 72.5.90.27 smtp.dealnews.com Linux 2.5 (sometimes 2.4) (4) Received: from [72.5.90.27] ([72.5.90.27:52671] helo=smtp.dealnews.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 4A/9E-08093-0B5721C4 for ; Fri, 11 Jun 2010 13:43:13 -0400 Received: (qmail 4754 invoked from network); 11 Jun 2010 17:43:01 -0000 Received: from unknown (HELO mail.dealnews.com) (10.1.10.7) by -H with ESMTPS (DHE-RSA-AES256-SHA encrypted); 11 Jun 2010 17:43:01 -0000 Received: (qmail 9097 invoked from network); 11 Jun 2010 17:43:07 -0000 Received: from h105.248.18.98.static.ip.windstream.net (HELO macdough.local) (brianm@98.18.248.105) by -H with ESMTPA; 11 Jun 2010 17:43:07 -0000 Message-ID: <4C1275AB.8000201@moonspot.net> Date: Fri, 11 Jun 2010 12:43:07 -0500 User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.1.9) Gecko/20100317 Thunderbird/3.0.4 MIME-Version: 1.0 To: PHP internals Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Detecting if a null variable exists? From: brian@moonspot.net (Brian Moon) Is it just me or are we missing a way in the language to check if a variable that has been set to NULL exists or not? is_null() on an unset variable throws a NOTICE. $var === null throws a notice. So, you have to use isset()? But, ah, $var = null; if(isset($var)) yields false. Is array_key_exists("var", $GLOBALS) the only solution to this problem? Seems silly. perhaps an var_exists() function is needed to fill this hole? -- Brian. -------- http://brian.moonspot.net/