RE: [PHP-DEV] wrong implementation of isset()?

From: Date: Tue, 06 Feb 2001 21:42:35 +0000
Subject: RE: [PHP-DEV] wrong implementation of isset()?
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-45876@lists.php.net to get a copy of this message
null, adjective: having no value IMHO, isset() should be left as is. Either way if you are looking for a null value you will have to use '== NULL' or is_null(). if (isset($a) && is_null($a)) if (isset($a)) if (is_null($a)) etc... The only possible situation I can think(right now) of where this might be useful is if you do not care that the value is null and null is a perfectly legal value(or non-value). In which case, all you are accomplishing is breaking everyone else's script who does not allow null values because they rely on isset() returning false and not letting these by. Chris -----Original Message----- From: Martin Jansen [mailto:mj@php.net] Sent: Tuesday, February 06, 2001 2:19 PM To: Andrei Zmievski; Bjoern Hoehrmann Cc: PHP Development Mailing List Subject: Re: [PHP-DEV] wrong implementation of isset()? On Tue, 6 Feb 2001 13:43:29 -0600, Andrei Zmievski wrote: >On Tue, 06 Feb 2001, Bjoern Hoehrmann wrote: >> >NULL == not set >> >> Great analysis. What about answering the question? Stanislav Malyshev >> said some months ago this is 'strange', see the discussion around bug >> 6076. Tell us at least, why this actually isn't strange. > >By default, any unset variable has value NULL - and isset(NULL) returns >false to indicate that. Similarly, assigning NULL to a variable unsets >it. But if I declare the variable in my script (and in the namespace), it's existing, no matter which value it has (String, Integer, NULL or whatever). As a result of that, isset() should return true. -Martin -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe@lists.php.net For additional commands, e-mail: php-dev-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.dev (#45876) next »