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

Reply via email to