title: Iterating over an object's array
body: <p>I have a class called User which has an array of products(objects).</p>
  
  <p>Somewhere else I have an array of users. The problem is that I want to have access to <code>products[0]</code> of <code>users[0]</code>.</p>
  
  <pre><code>$users[0] = new User("ion","ion123","seller",$productsUser0);   
  //construct allProducts array
  $allProdCounter = 0;
  $usr = $users[0];
  $prodArray = &amp;$users[0]-&gt;productsArray;
  print_r($prodArray);
  </code></pre>
  
  <p>When I run the code, there appears the following error:</p>
  
  <blockquote>
    <p>Indirect modification of overloaded property User::$productsArray has no effect </p>
  </blockquote>
  
  <p>What is the problem?</p>