Re: distinguish between null variable and unset variable
| From: | Daniel Brown | Date: | Thu, 22 Jan 2009 02:11:56 +0000 |
| Subject: | Re: distinguish between null variable and unset variable | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-286984@lists.php.net to get a copy of this message | ||
On Wed, Jan 21, 2009 at 20:27, Jack Bates <ms419@freezone.co.uk> wrote:
> How can I tell the difference between a variable whose value is null and
> a variable which is not set?
Unfortunately, in PHP - like other languages - you can't.
A variable is considered to be null if:
* it has been assigned the constant NULL.
* it has not been set to any value yet.
* it has been unset().
--
</Daniel P. Brown>
daniel.brown@parasane.net || danbrown@php.net
http://www.parasane.net/ || http://www.pilotpig.net/
Unadvertised dedicated server deals, too low to print - email me to find out!