Re: [PHP-DEV] Inconsistency of empty() and isset() ?

2006-04-17 Thread Ron Korving
isset() does more than check the existance in a hash table, because this the following is true: $foo = null; isset($foo); // returns false, even though $foo is initialized echo $foo;// will not cause a NOTICE, because $foo is initialized - Ron Richard Lynch [EMAIL PROTECTED] wrote in

Re: [PHP-DEV] Inconsistency of empty() and isset() ?

2006-04-17 Thread itrebal
Should I go ahead and submit this patch? Where should I go about doing so? I looked around bugs.php.net but am unsure. On 4/17/06, Ron Korving [EMAIL PROTECTED] wrote: isset() does more than check the existance in a hash table, because this the following is true: $foo = null; isset($foo);

Re: [PHP-DEV] Inconsistency of empty() and isset() ?

2006-04-17 Thread Andi Gutmans
We had a huge thread about this a while back (1-2 years) where this was discussed in great depth. The agreement was that for isset() it's very straight forward and usefull and that the semantics with empty() would be confusing and problematic, and therefore, the decision was to just support

Re: [PHP-DEV] Inconsistency of empty() and isset() ?

2006-04-17 Thread Andi Gutmans
Nope you shouldn't, as per my previous email. At 10:46 AM 4/17/2006, [EMAIL PROTECTED] wrote: Should I go ahead and submit this patch? Where should I go about doing so? I looked around bugs.php.net but am unsure. On 4/17/06, Ron Korving [EMAIL PROTECTED] wrote: isset() does more than check

Re: [PHP-DEV] Inconsistency of empty() and isset() ?

2006-04-16 Thread Lukas Smith
Derick Rethans wrote: On Sat, 15 Apr 2006 [EMAIL PROTECTED] wrote: The following is a direct excerpt from the PHP manual on empty, and isset: bool *empty* ( mixed var ) bool *isset* ( mixed var [, mixed var [, ...]] ) Is there a reason empty does not allow multiple variables at a time, as

Re: [PHP-DEV] Inconsistency of empty() and isset() ?

2006-04-16 Thread Richard Lynch
On Sun, April 16, 2006 4:40 pm, Derick Rethans wrote: On Sat, 15 Apr 2006 [EMAIL PROTECTED] wrote: There is a thought about it, and that is that we could not decide whether it should be an AND or an OR test between the different parameters. I'm curious to know whoulda thunk it would be OR,

Re: [PHP-DEV] Inconsistency of empty() and isset() ?

2006-04-16 Thread Etienne Kneuss
As empty is quite the contrary of isset, the OR would be preferable over AND. Indeed: if(!empty($var1) !empty($var2)) could be simplified to if(!empty($var1, $var2)) Regards. -- Etienne Kneuss http://www.colder.ch/ [EMAIL PROTECTED] -- PHP Internals - PHP Runtime Development Mailing

Re: [PHP-DEV] Inconsistency of empty() and isset() ?

2006-04-16 Thread Pierre
On 4/17/06, Lukas Smith [EMAIL PROTECTED] wrote: Derick Rethans wrote: On Sat, 15 Apr 2006 [EMAIL PROTECTED] wrote: The following is a direct excerpt from the PHP manual on empty, and isset: bool *empty* ( mixed var ) bool *isset* ( mixed var [, mixed var [, ...]] ) Is there a reason

Re: [PHP-DEV] Inconsistency of empty() and isset() ?

2006-04-16 Thread Brian Moon
Indeed, especially as everyone will tell you that isset and empty are equivalent. Are you saying that people misunderstand that or that you believe that to be true? I see that misunderstanding a lot. I have to educate people on that. They don't seem to grok the subtle, yet crucial (and I

Re: [PHP-DEV] Inconsistency of empty() and isset() ?

2006-04-16 Thread Richard Lynch
On Sun, April 16, 2006 6:25 pm, Etienne Kneuss wrote: As empty is quite the contrary of isset, the OR would be preferable over AND. Sorry, folks! I meant the other way 'round... Whatever it is you check with a zillion form inputs, that's what you'd want. When would you need it the other way

Re: [PHP-DEV] Inconsistency of empty() and isset() ?

2006-04-16 Thread itrebal
What it comes down to, is it runs the exact same code on the variables, I just changed the method of which they were called (ie: allowed multiple.) On 4/16/06, Richard Lynch [EMAIL PROTECTED] wrote: On Sun, April 16, 2006 7:38 pm, Pierre wrote: isset and empty share the same implementation,