RE: [PHP-DEV] what happened to that new isset() like language
| From: | David Zülke | Date: | Sat, 29 Oct 2005 22:47:32 +0000 |
| Subject: | RE: [PHP-DEV] what happened to that new isset() like language | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-19830@lists.php.net to get a copy of this message | ||
You are joking, aren't you?
- David
> -----Original Message-----
> From: Sebastian [mailto:buddhahead@gmail.com]
> Sent: Sunday, October 30, 2005 12:43 AM
> To: Greg Beaver
> Cc: internals@lists.php.net
> Subject: Re: [PHP-DEV] what happened to that new isset() like language
>
> I still think // and //= would be the most reasonable. They involve
> the least amount of syntax and // looks similar to ||
>
> On 10/29/05, Greg Beaver <cellog@php.net> wrote:
> > Sara Golemon wrote:
> > >>> Evaluating an idea based on it's syntactic similarities to other
> > >>> languages is complete and utter nonsense. It has nothing to with
> being
> > >>> like language Xyz. It has to do with familiarity to language
> constructs.
> > >>> One already understands the idea of 'this || that'. It's
> > >>> certainly
> > >>
> > >>
> > >> I'll throw the water on this one:
> > >>
> > >> <?php
> > >> $c = 0;
> > >> $a = 1;
> > >> var_dump($c || $a);
> > >> ?>
> > >>
> > >> Changing true into false consitutes a rather severe BC break :).
> > >>
> > > How about ||| and |||= ?
> >
> > I don't think the meaning of this operator is obvious. Right now, the
> > only operators whose meaning are not immediately obvious (in my eyes)
> are:
> >
> > @ - error suppression
> > & - make reference in some cases, bitwise and in others
> > ^ - bitwise xor but what are you gonna do :)
> >
> > For an operation as complicated as "use the first variable that exists"
> > I would be most comfortable with:
> >
> > $d = first-existing: $a, $b, $c;
> >
> > This way, no conflict with functions (parse error in previous php
> > versions), and it is extremely clear. The parser would look for
> >
> > T_FIRSTEXISTING ':' existing_varlist
> >
> > in the expression section, and of course defining existing_varlist as:
> >
> > existing_varlist:
> > variable
> > | existing_varlist ',' variable
> > ;
> >
> > Greg
> >
> > --
> > PHP Internals - PHP Runtime Development Mailing List
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>
>
> --
>
>
>
> -------------
> buddhahead@gmail.com
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>