title: Returning by reference. Parentheses around a return variable
body: <p><a href="http://php.net/manual/en/function.return.php" rel="nofollow noreferrer">http://php.net/manual/en/function.return.php</a></p>
  
  <blockquote>
    <p>You should never use parentheses around your return variable when returning by reference, as this will not work. You can only return variables by reference, not the result of a statement. If you use return ($a); then you're not returning a variable, but the result of the expression ($a) (which is, of course, the value of $a)."</p>
  </blockquote>
  
  <p>I tried this piece of code and it works: </p>
  
  <pre><code>&lt;?php
  function &amp;one($param1) {
      $a = $param1 * 2;
      return $a;
  }
  
  function &amp;two($param2) {
      $b = $param2 * 2;
      return ($b); //Parentheses around the return variable
  }
  
  $_1 =&amp;one(10);
  echo $_1 . "&lt;/br&gt;"; //outputs "20"
  
  $_2 =&amp;two(10);
  echo $_2 . "&lt;/br&gt;"; //outputs "20", the same thing
  </code></pre>
  
  <p>What code example would explain it better (show what the note is talking about)? </p>
  
  <p>Thanks. </p>