Re: wrong implementation of isset()?
| From: | Cynic | Date: | Wed, 07 Feb 2001 02:02:19 +0000 |
| Subject: | Re: wrong implementation of isset()? | ||
| References: | 1 2 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-45911@lists.php.net to get a copy of this message | ||
with all respect to the people who develop the language, I
think this is nonsense:
$rs = mysql_query( 'select x, y, z from foo where ...' ) ;
$x = mysql_fetch_array( $rs , MYSQL_NUM ) ;
var_dump( $x[2] ) ;
var_dump( isset( $x[2] ) ) ;
NULL # well, the column contains null values
bool(false)
But since (almost) everybody else disagrees, I must be missing
something obvious.
BTW, does $x = null really equal to unset( $x ) or does
isset() just get fooled by its value?
At 01:55 7.2. 2001, André Langhorst wrote the following:
--------------------------------------------------------------
>>Perhaps, in order to maintain compatibility, we should re-document is_set,
>>create the documentation for is_null, and look into creating a new function
>>that will determine if something has "ever been inside the namespace", regardless
>>of its current value, or absence of value.
>
>we should just define (and document) this similar to Andrei (note, I do not use the word
>"the same" I use that word equal, what means different things):
>
>NULL equals absence_of_value equals absence_of_variable_in_namespace
>
>I can imagine no case where people would need to differentiate between NULL and never been in
>namespace, we should not allow this, otherwise we would introduce the differentiation into a third
>state, non existent, what raises the wtf-factor and is not required as far as I can think
>
>andré
>
>
>--
>· André Langhorst · t: +49 571 3201801 ·
>· waldschrott@php.net · m: +49 173 9558736 ·
>· PHP Quality Assurance · http://qa.php.net ·
>
>
>--
>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
>
------end of quote------
____________________________________________________________
Cynic:
A member of a group of ancient Greek philosophers who taught
that virtue constitutes happiness and that self control is
the essential part of virtue.
cynic@mail.cz