Static variable variables in php 5.2
<p>I'm trying to define the following function:</p>

<pre><code>function set($key, $value, $default = null)
    {
    if ($value)
        static $$key = $value;
    else
        static $$key = $default;
    }
</code></pre>

<p>But when I call it, I get the error "Parse error: syntax error, unexpected '$', expecting T_VARIABLE". I guess there is a problem with defining static variable variables, but I can't find a workaround. Can you? Thanks!</p>
