title: PHP "&" operator
body: <p>I'm not a PHP programmer (but know other languages), and I'm trying to understand a web page that was done in PHP (5.1.6) in order to do some changes.</p>
  
  <p>The page has the following code (simplified):</p>
  
  <pre><code>$db_hosts = array();
  $sql = 'SELECT h.hostid, h.host FROM hosts h ';
  
  $db_items = DBselect($sql);
  
  while($db_item = DBfetch($db_items)){
      $name = $db_item['host'];
      $db_host = &amp;$db_hosts[$db_item['hostid']];
  }
  </code></pre>
  
  <p>I'm trying to understand the last line, <code>$db_host = &amp;$db_hosts[$db_item['hostid']];</code>.</p>
  
  <p>It seems to be creating a new variable, <code>$db_host</code>, and putting something inside it, but I don't understand <code>&amp;$db_hosts</code>.</p>
  
  <p>I'm in doubt because as far as I know, <code>$db_hosts</code> is an empty array.</p>
  
  <p>I found <a href="https://stackoverflow.com/questions/1367454/what-do-operators-in-php-mean">this</a> and <a href="https://stackoverflow.com/questions/600202/understanding-phps-operator">this</a>, but I'm not quite sure, because in these links, the operator is "=&amp;", and in the code, the operator is attached to the variable "= &amp;$db_hosts" (it has an space between = and &amp;).</p>
  
  <p>Since I tried to modify it and didn't get success, I thought that it was better to ask for help...</p>