Re: [PHP-DEV] Detecting if a null variable exists?

2010-06-14 Thread Christian Schneider
Frederic Hardy wrote: >> I however have never seen a proper usecase.. > > class foo { > public function __call($method, $arguments) > { > // We MUST have at least ONE argument ! > if (array_key_exists(0, $arguments) === false) // > isset($arguments[0]) return false if first

Re: [PHP-DEV] Detecting if a null variable exists?

2010-06-12 Thread Frederic Hardy
Hello ! Is it just me or are we missing a way in the language to check if a variable that has been set to NULL exists or not? is_null() on an unset variable throws a NOTICE. $var === null throws a notice. So, you have to use isset()? But, ah, $var = null; if(isset($var)) yields false. Is a

Re: [PHP-DEV] Detecting if a null variable exists?

2010-06-11 Thread Hannes Magnusson
On Fri, Jun 11, 2010 at 19:43, Brian Moon wrote: > Is it just me or are we missing a way in the language to check if a variable > that has been set to NULL exists or not? > > is_null() on an unset variable throws a NOTICE. > $var === null throws a notice. > > So, you have to use isset()? But, ah,

[PHP-DEV] Detecting if a null variable exists?

2010-06-11 Thread Brian Moon
Is it just me or are we missing a way in the language to check if a variable that has been set to NULL exists or not? is_null() on an unset variable throws a NOTICE. $var === null throws a notice. So, you have to use isset()? But, ah, $var = null; if(isset($var)) yields false. Is array_key_e