Passing objects to new objects
<pre><code>$P1 = new Player(array(
    'name' =&gt; 'Player 1',
    'strat' =&gt; new Strategy(&amp;$this)
));
</code></pre>

<p>This is more or less what I'm trying to do. The reference to $this is obviously wrong. What is the best way to accomplish something like this?</p>

<p>Basically, the new Strategy object needs to know what Player it belongs to.</p>

<p>Sure I could do like:</p>

<pre><code>$P1 = new Player();
$P1-&gt;strat = new Strategy(&amp;P1);
</code></pre>

<p>but that doesn't seem as concise.</p>

<p>Update:</p>

<p>I guess instead of passing the new strategy object in the array, I would pass the name of the strategy class instead, and then instantiate a new object in the Player constructor.</p>
