Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:48764 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 48654 invoked from network); 14 Jun 2010 06:46:37 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Jun 2010 06:46:37 -0000 X-Host-Fingerprint: 78.142.172.145 gate-g21.inqnet.at Received: from [78.142.172.145] ([78.142.172.145:16132] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 0D/1E-04758-B40D51C4 for ; Mon, 14 Jun 2010 02:46:35 -0400 Message-ID: <0D.1E.04758.B40D51C4@pb1.pair.com> To: internals@lists.php.net Date: Mon, 14 Jun 2010 08:46:29 +0200 User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.9) Gecko/20100330 Shredder/3.0.4 MIME-Version: 1.0 References: <4C1275AB.8000201@moonspot.net> In-Reply-To: <4C1275AB.8000201@moonspot.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Posted-By: 78.142.172.145 Subject: Re: Detecting if a null variable exists? From: mike@php.net (Michael Wallner) On 06/11/2010 07:43 PM, Brian Moon wrote: > 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? >... > perhaps an var_exists() function is needed to fill this hole? > php -r 'function f(){$f=null; var_dump(array_key_exists("f", get_defined_vars()));} f();' Mike