Weird variable behaviour PHP
<p>This little piece of code isn't behaving as I would expect it to:</p>

<pre><code>$flash_messages = $_SESSION['flash'];

$_SESSION['flash'] = array();

return $flash_messages;
</code></pre>

<p>I am wanting <code>$flash_messages</code> to have the saved values of the <code>$_SESSION</code> variable. But when I change the <code>$_SESSION</code> to a blank array, flash messages is also returned as a blank array. What is going on?</p>
