Defining a function inside a conditional
<p>Snippet 1 works. Snippet 2 doesn't. Why?</p>

<p>1.</p>

<pre><code>foo();

function foo()
{
    // do soemething
}
</code></pre>

<p>2.</p>

<pre><code>foo();

if(!function_exists("foo"))
{
    function foo()
    {
        // do soemething
    }
}
</code></pre>
