There has been a recent thread on the internals list as to the meaning
and usage of the "null" datatype. Zeev claims, perhaps rightly so, the
following:

Zeev wrote:
>
> null is not a value, was never meant to be a value, and won't be a
> value

Interestingly though, the PHP documentation at

    http://www.php.net/manual/en/language.types.null.php

indicates the following:

    The special NULL value represents that a variable has no value. NULL
    is the only possible value of type NULL. 

Which is obviously contradictory since it claims to be a variable having
no value and yet also claims it is a special value. Also the following
snippet from: 

    http://www.php.net/manual/en/language.operators.assignment.php

seems to also indicate that null is a value -- namely:

    The basic assignment operator is "=". Your first inclination might
    be to think of this as "equal to". Don't. It really means that the
    the left operand gets set to the value of the expression on the
    rights (that is, "gets set to"). 

The above reference might not be obvious, but since you can assign the
null constant, then it says the "left operand gets set to the value
of..." seemingly indicating that null is a value.

Now the point of the discussion is not to indicate who is right or who
is wrong -- that would appear to be a ridiculous argument. I am more
interested in finding out the practices and experience of PHP
developers. I'd like to know how many people treat null as a value, and
how many do not. For instance to you ever assign default values of null
to instance variables, or local variable, or array entries? I know in
practice that I have, and find it quite convenient to represent a
default value.

Cheers,
Rob.
-- 
.---------------------------------------------.
| Worlds of Carnage - http://www.wocmud.org   |
:---------------------------------------------:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.    |
`---------------------------------------------'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to