FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Operator precedence
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Operator precedence [message #185050 is a reply to message #185049] Tue, 25 February 2014 03:17 Go to previous messageGo to previous message
Thomas 'PointedEars'  is currently offline  Thomas 'PointedEars'
Messages: 701
Registered: October 2010
Karma:
Senior Member
Ben Bacarisse wrote:

> Thomas 'PointedEars' Lahn <PointedEars(at)web(dot)de> writes:
>> Ben Bacarisse wrote:
>>> Thomas 'PointedEars' Lahn <PointedEars(at)web(dot)de> writes:
>>>> Ben Bacarisse wrote:
>>>> > […] Expressions are built from operators, but is ',' an operator in
>>>> > [PHP?
>>>> > It appears in the operator precedence table but it isn't an operator
>>>> > in an sense that would normally be understood by someone familiar with
>>>> > these terms.
>>>>
>>>> ECMAScript has a “Comma Operator”, too.
>>>
>>> But my point was the PHP doesn't have one --
>>
>> But it does:
>>
>> for ($i = 0, $j = 42; $i < $j; ++$i);
>
> But try this:
>
> for (($i = 0, $j = 42); $i < $j; ++$i);

Bogus example.

> In general, putting an expression in parentheses does not stop it being
> an expression.
>
> The permission to use ',' in a for statement is special
> syntax: it's not part of the syntax for an expression. To give another
> example, if the ',' in a for statement built an expression you should be
> able to change:
>
> for ($i = 0; f($1), $i < 10; $i++) { ...; }
>
> into
>
> $i = 0;
> while (f($1), $i < 10) { ...; $i++; }
>
> but you can't, because while takes an expression as the condition, and
> f($i), $i < 10 is not an expression!

Irrelevant.

>>> not in any normal sense of the word.
>>
>> Please define what you consider to be an operator in a “normal sense of
>> the word”.
>
> It's a syntactic symbol that can be used to combine simpler expressions
> in such a way that the result is also, syntactically, an expression.

A very narrow definition of “operator”.


PointedEars
--
Sometimes, what you learn is wrong. If those wrong ideas are close to the
root of the knowledge tree you build on a particular subject, pruning the
bad branches can sometimes cause the whole tree to collapse.
-- Mike Duffy in cljs, <news:Xns9FB6521286DB8invalidcom(at)94(dot)75(dot)214(dot)39>
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Correlating curl resources to some other object.
Next Topic: Experienced Web designer required
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sun Nov 24 04:10:46 GMT 2024

Total time taken to generate the page: 0.04033 seconds