returning boolean on class method
<p>I have a class with a couple of methods</p>

<p><code>deleteUploadedFile()</code> and <code>currentUploadedFiles()</code>.</p>

<p>currentUploadedFiles(), basically loops over a session array and displays it on screen, simple as. Code sample:</p>

<pre><code>function currentUploadedFiles()
    {
        if(isset($_SESSION['fileArray']) &amp;&amp; $this-&gt;count &gt; 0)
        {
            echo '&lt;p style="clear:both"&gt;Current files uploaded list:&lt;/p&gt;';
            echo '&lt;ol&gt;';

            foreach($_SESSION['fileListing'] as $key =&gt; $value )
            {
                echo '&lt;li&gt;'. $value .' &lt;a href="'.$_SERVER["PHP_SELF"].'?id='.$key.'"&gt;[Remove File]&lt;/a&gt;&lt;/li&gt;';
            }

            echo "&lt;/ol&gt;\n\r";
            echo "&lt;p&gt; Current file size allowance: ". $this-&gt;_returnRemainingSessionFileSize() ." of 8 MB";
        } else {
            echo '&lt;p style="clear:both"&gt;No files have been uploaded yet&lt;/p&gt;';
        }    

        if($this-&gt;deleteUploadedFile() === true)
        {
            echo '&lt;p&gt;File has now been deleted from our records.&lt;/p&gt;';
        }
    }
</code></pre>

<p>the deleteUploadedFile() method, basically when form is submitted it deletes file from the server and removes the entry from the session array. Sample code:</p>

<pre><code>function deleteUploadedFile()
    {
        (int) $id = $_GET['id'];
        (bool) $deleted = false;

        if (file_exists($this-&gt;target_path.'/'.$_SESSION['fileArray'][$id]))
        {

            $_SESSION['fileSize'] -= $this-&gt;_checkSessionFileSize($id);

            if (unlink($this-&gt;target_path.'/'.$_SESSION['fileArray'][$id]))
            {

                $deleted = true; //'&lt;p&gt;File has now been deleted from our records.&lt;/p&gt;';
                unset($_SESSION['fileArray'][$id]);
                unset($_SESSION['fileListing'][$id]);


            }

        }

        return $deleted;

    }
</code></pre>

<p>my controller, basically checks if file id# isset, then checks if the array id# isset, then calls the <code>deleteUploadedFile()</code> method and then calls the <code>currentUploadedFiles()</code> method.</p>

<p>Question is, why when I var_dump $deleted var in <code>deleteUploadedFile()</code> I get bool(true) but inside the <code>currentUploadedFiles()</code> method I get bool(false). Sounds like I'm messing up the scope somehow?</p>
