PHP Static variable not working as expected
<p>This <a href="http://my.php.net/static" rel="nofollow">example</a> is from php.net:</p>

<pre><code>&lt;?php
function Test()
{
    static $a = 0;
    echo $a;
    $a++;
}
?&gt;
</code></pre>

<p>And this is my code:</p>

<pre><code>function getNextQuestionID()
{
 static $idx = 0;
 return $idx++;
}
</code></pre>

<p>And I use it in JavaScript:</p>

<pre><code>'quizID=' + "&lt;?php echo getNextQuestionID(); ?&gt;"
</code></pre>

<p>Returns 0 everytime. Why?</p>
