Function called and declared within switch construct gives error
<p>I am new to PHP. Well the text i am referring to say quotes<br>
<b>Functions can be defined anywhere within your program.</b></p>

<p>the above statement holds fine for code block 1 but not for code block 2. KINDLY EXPLAIN?</p>

<p><strong>CODE Block 1:</strong></p>

<pre><code>&lt;?php
test();
function test()
{
    echo "Hello Inside the function";
}
?&gt;
</code></pre>

<p><strong>CODE Block 2:</strong></p>

<pre><code>&lt;?php
$no=1;
switch ($no)
{
case "1":
    test();
function test()
    {
    echo "Hello test";
        }
 }
?&gt;
</code></pre>
