# null / unset / isset ?

- Thread: https://externals.io/message/9010
- Original archive: https://news-web.php.net/php.internals/9010
- Started by Jochem Maas on 2004-04-08T18:05:59+00:00
- Messages: 2
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #9010 — Jochem Maas — 2004-04-08T18:05:59+00:00

URL: https://externals.io/message/9010#9010

consider this if you will:

<?

echo <<< ___THEEND
EXPECT:
isset(): true;
 `is_null()`: true;

REALITY:
___THEEND;

$varIsSet = null;
var_dump( isset($varIsSet) );
var_dump( is_null($varIsSet) );

?>

I would have thought that having set the variable to something even if 
its 'nothing' would mean it is set in the current variable scope.

either that or it makes unset() redundant, no? and the PHP documentation
leaves me with the impression that `is_null()` works with 'set' variables 
(and would give an `E_NOTICE` if an unset variable is set)

is there a difference between null and unset()ing? does a variable that 
is null take up no memory (rather like variable that have never been 
defined or removed completely)

apologies if this is misplaced.

rgds,

Jochem

---

## #9011 — Wez Furlong — 2004-04-08T18:09:49+00:00

URL: https://externals.io/message/9010#9011 · In reply to: #9010

php-general@lists.php.net

From: "Jochem Maas" <jochem@iamjochem.com>
> apologies if this is misplaced.
