title: PHP behavior with parenthesis and object members
body: <p>Recently I was working with results from an SQL query call on a mysqli object. I wrote this line of code:</p>
  
  <pre><code>$record = ($result-&gt;fetch_object())-&gt;acc_id;
  </code></pre>
  
  <p>and i got <code>Parse error: syntax error, unexpected '-&gt;' (T_OBJECT_OPERATOR)</code> for that line.</p>
  
  <p>Once i changed the code to this:</p>
  
  <pre><code>$record = $result-&gt;fetch_object()-&gt;acc_id;
  </code></pre>
  
  <p>it  worked as intended.</p>
  
  <p>Why did the parenthesis induce a parse error? I know that in C# the former code would work regardless of them (accounting for the change in syntax)?</p>