title: PHP pass array by reference
body: <ol>
  <li><p>What is a correct way to use <code>array_splice</code> in PHP? The function header clearly says:</p>
  
  <p><code>array_splice ( array &amp;$input , int $offset...</code> so it should accept reference as a first argument.</p>
  
  <p>However, a line</p>
  
  <p><code>array_push(&amp;$this-&gt;contextsIds, $contextId);</code></p>
  
  <p>Triggers an error <strong>Deprecated: Call-time pass-by-reference has been deprecated in ... line 132</strong></p></li>
  <li><p>How do I return a reference to an array? I have:</p>
  
  <pre><code>public function &amp;getContextsIds() {
      return is_array($this-&gt;contextsIds) ? $this-&gt;contextsIds : array();    
  }
  </code></pre>
  
  <p>but it says <strong>Notice: Only variable references should be returned by reference</strong></p></li>
  </ol>