2011-04-19 130 views

回答

0
<?php 
class Foo { 
    public static $bar = 'test'; 
} 

echo Foo::$bar; 

function bar() { 
    static $a = 1; 

    return $a++; 
} 

echo bar(); 
echo bar(); 
?> 

或者我不明白这一点。

+0

http://talks.php.net/show/veracruz/50 - 你可能想检查一下链接来找出变量变量是 – lakridserne 2011-04-19 09:45:28

+0

使用'$ static_array [$ var] = $ value;'而不是'$$ var = $ value;' – Emmerman 2011-04-19 09:53:41