PHP order of logical operators
<p>I'm curious about how PHP handles conditional statements / order of operations with nesting.  If I use the following <code>if</code> condition:</p>

<pre><code>if(x == (1 || 2))
{
    // do something
}
</code></pre>

<p>I would expect it to behave the same as</p>

<pre><code>if(x == 1 || x == 2)
{
    // do something
}
</code></pre>

<p>...but it doesn't.  My first example seems like it would be a handy shorthand that makes pretty good sense, but it doesn't do what I expect.  Can anyone shed some light on the issue?  What exactly does PHP do with my first statement?</p>
