How to delete an object from within itself?
<p>I have an array of objects (A) which has an array of objects (B) inside it.<br>
I'm trying to move B to a different object in array A.<br>
I'm trying to use this:</p>

<pre><code>public function killToken($a) {
    array_push($a-&gt;tokens,$this);  // Put this token in new array (works)
    unset($this);                  // Remove token from this array (does not work)
}
</code></pre>

<p>I call this function via: <code>$b-&gt;killToken($a);</code></p>

<p>I've tried several variations on this, but I just can't figure out how to get rid of the object from inside itself.</p>

<p>Any help would be appreciated.</p>
