title: Creating an array of objects in PHP
body: <p>I would like to know what is the right of creating objects arrays in php.<br/>
  My goal here is to be able to get data like this:</p>
  
  <pre><code>$obj = new MyClass();
  echo $obj[0]-&gt;parameter; //value1
  echo $obj[1]-&gt;parameter; //value2
  </code></pre>
  
  <p>Thanks for your time.</p>
  
  <p>EDIT:
  And if I want to do it in class it should look like this?</p>
  
  <pre><code>class MyClass{
      public $property;
  
      public function __construct() {
          $this-&gt;property[] = new ProjectsList();
      }
  }
  </code></pre>