Re: what happened to that new isset() like language
| From: | Sebastian | Date: | Sat, 29 Oct 2005 22:43:20 +0000 |
| Subject: | Re: what happened to that new isset() like language | ||
| References: | 1 2 3 4 5 6 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-19828@lists.php.net to get a copy of this message | ||
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