On Thu, 2003-08-14 at 12:41, Derick Rethans wrote:
> On Thu, 14 Aug 2003, walt boring wrote:
> 
> > Then please explain the logic of why
> > $var = null
> > 
> > isset($var) returns false.
> > 
> > In your words "it will see if a variable is set (has a value)".
> > 
> > $var IS set and DOES have a value, it just happens to be a value of
null.
> 
> I've done a fair deal of PHP programming and I never had the need to
do 
> this... What use do you have for a variable with the value NULL? 
> 
> Derick

Well, one might use it to represent a NULL value, much like we do with
dbs. I imagine that they had a reason for giving us a way to work with
NULL. Otherwise we'd just destroy the variable and be done with it.

Here's one thing: it's more straightforward to do

  if (variable_exists($arr[1][2][4])) {. . .}

than

  if (array_key_exists(4, $arr[1][2]) {. . .}

...especically since array_key_exists() will start spewing notices if
any subarray in the array you pass in does not exist. You can work
around it, but then the chain of workarounds to handle something many
would argue should be basic functionality gets a little over-the-top.


-- 
 Torben Wilson <[EMAIL PROTECTED]>                        +1.604.709.0506
 http://www.thebuttlesschaps.com          http://www.inflatableeye.com
 http://www.hybrid17.com                  http://www.themainonmain.com
 -----==== Boycott Starbucks!  http://www.haidabuckscafe.com ====-----


-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to