Array of custom Object in PHP like Java
<p>In Java,</p>

<p>I can create something like the following:</p>

<pre><code>public class A {
    private final SomeCustomClass[] nodes;

    public A() {
        //create new SomeCustomClass
        node1 = new SomeCustomClass(100, 200);

        //create the more SomeCustomClass as array
        nodes = new SomeCustomClass[100]; //this is a array of type "SomeCustomClass"

        //fill these nodes
        for (int i = 0; i &lt; 100; i++) {
            nodes[i] = new SomeCustomClass(1, 5);
        }

    }
}
</code></pre>

<p>Would the following suffice as its PHP implementation? I'm confused about the Java's <code>nodes = new SomeCustomClass[100]</code> part.</p>

<pre><code>class A {

    private $node1;
    private $nodes;

    public function __construct() {
        //create new SomeCustomClass
        $this-&gt;node1 = new SomeCustomClass(100, 200);

        //create the more SomeCustomClass as array
        $this-&gt;nodes = new ArrayObject();

        //fill these SomeCustomClass
        for ($i = 0; $i &lt; 100; $i++) {
            $this-&gt;nodes[$i] = new SomeCustomClass(1, 5);
        }

    }
}
</code></pre>

<p>I have <code>SomeCustomClass</code> which is my own defined class.</p>