On 14 April 2011 11:07, Reindl Harald <h.rei...@thelounge.net> wrote:
>
> Am 14.04.2011 12:02, schrieb Richard Quadling:
>
>> I always declare my variables. So, I don't want to use isset() as they
>> will be an incorrect test. I use is_null(). Specifically testing the
>> value. If I've made a mistake and NOT declared the variable (or made a
>> typo), I want to know. I don't want to hide it with isset()/empty()
>
> yes and no
>
> $config['modulename'] = array
> (
>  'icon' => 'bla.gif',
>  'default_params' => array
>  (
>  'autocleanup'       => 1,
>  'ignore_user_abort' => 0,
>  )
> );
>
>
> if 'default_params' are optional you NEED isset() to decide
> do something with them or skip operations
>
>

I think that depends upon the developer.

I don't mix the tests for existence.

Mixing the tests means a typo in the isset() will hide the lack of existence.

But array_key_exists() is not going to do that. If the key exists then
I can process it. If not, then I can't.





-- 
Richard Quadling
Twitter : EE : Zend
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY

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

Reply via email to