Oh come on Andi, are you telling me you can't do everything at once?

Yes, I don't care about which one is the non-set variable.  I'd be glad to
help on making this function work like that, but I'm afraid my C is rusty
enough to require Tetanus shots for everyone involved. :) (Okay so it isn't
really that bad.)

Well, I remember reading that someone suggested making it so that any
negative number was false.  So if that was the case and I did the following:

$a = 1;
$b = 2;
$d = 4;

$play_nice = isSet($a, $b, $c, $d);

if (!$play_nice) {
    print "The variable missing is in position ";
    print ($play_nice*-1);
}

And it would print 3, in which case we would know $c is not set.  I'm not
that sure about this approach, seems like a hack, but the
I-don't-care-which-one-isn't-set approach seems fine to me.

Maybe a poll?

(X) Extend the isset() and empty() functions to encompass multiple
    variables as one inclusive logic test.
( ) Don't touch my beloved functionality vile creatures!

-Chris

> From: Andi Gutmans [mailto:[EMAIL PROTECTED]]
> Subject: RE: [PHP-DEV] feature request
>
>
> It should be possible to do this. I'll look into it. But I also need to
> think about how much sense it makes :)
> Today you're asking for isset(...,...,...). Tomorrow you will ask to know
> which one was not set if it failed.
> So I hope what youreally want is only the first.
>
> Andi
>
> At 09:42 PM 3/18/2001 -0500, Mike Robinson wrote:
> >Chris Newbill writes:
> >
> > > 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.
> >
> >Ditto.
> >It would be handy. If you are willing and able to do
> >stuff like this, maybe a request for additional karma
> >would be in order.
> >
> >Mike Robinson
> >
> >
> >
> >
> >
> >--
> >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