This would not be a bad idea IMHO and I would use it for some things.

The functionality would be inclusive not exclusive.  So isset($var1, $var2,
$var3) would only return true if $var1, $var2, and $var3 are set and false
otherwise.

So If I had a form passing $name, $email, $phone:

example #1
if (isSet($name, $email, $phone))
   // ALL GOOD

Instead of

example #2
if ((isSet($name)) &&
    (isSet($email)) &&
    (isSet($phone)))
    // ALL GOOD

Granted if one variable wasn't set, then you might run into some minor
issues if you want to figure out which one is not set.  But that is the
developers choice. :)

It wouldn't break existing functionality, seems simple enough to implement
(although my karma is limited to doc's so someone else would have to do it),
and would make some people happy.  That seems to be reason enough to do it.

Just my 2 cents.

-Chris

> From: Gavin Sherry [mailto:[EMAIL PROTECTED]]
>
> Cameron,
>
> On Mon, 19 Mar 2001, Cameron wrote:
>
> > would be nice if isset would act the same as unset, being able to feed
> > it more than 1 var at a time
> >
> > ie. if ( isset ( $blah1, $blah2 ) ) { blah blah }
>
> This is probably a bad idea since isset() needs to return true or false
> for each argument it receives. (Any other mode of operation is too
> complicated).
>
> This means that you need to return the values for each variable as an
> array and that each value from the array needs to be tested. This results
> in more typing than you would previously have been doing and is more
> computationally intensive.
>
> I suggest just stick with the current implementation.
>
> Gavin
>
>
> --
> PHP Development Mailing List <http://www.php.net/>
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to