PHP array_shift() not working for me. What am I doing wrong?
<p>I am creating an array and want to delete the first element of the array and re-index it.  From what I can tell, array_shift() is the right solution.  However, it is not working in my implementation.  </p>

<p>I have a member variable of my class that is defined as an array called $waypoint_city.  Here is the variable output prior to shifting the array: </p>

<pre><code>print_r($this-&gt;waypoint_city);
</code></pre>

<p>Result: </p>

<pre><code>Array ( [0] =&gt; [1] =&gt; JACKSONVILLE [2] =&gt; ORLANDO [3] =&gt; MONTGOMERY [4] =&gt; MEMPHIS )
</code></pre>

<p>If I do the following, I get the correct result: </p>

<pre><code>print_r(array_shift($this-&gt;waypoint_city));
</code></pre>

<p>Result: </p>

<pre><code>Array ( [0] =&gt; JACKSONVILLE [1] =&gt; ORLANDO [2] =&gt; MONTGOMERY [3] =&gt; MEMPHIS )
</code></pre>

<p>However, if I try to reassign the result to the member variable it doesn't work...  Anyone know why that is?  </p>

<pre><code>$this-&gt;waypoint_city = array_shift($this-&gt;waypoint_city);
</code></pre>

<p>If I try to print_r($this->waypoint_city) it looks like nothing is in there.  Thanks to anyone who can save the hair that I haven't pulled out, yet.  </p>
