Thursday, January 29, 2009

[PHP Study]$GLOBALS and $_REQUEST?

php5.3
php.ini的设置:
variables_order = "GPCS"
request_order = "GP"

直接 var_dump($GLOBALS); 却发现只有 GPCF四个变量,连_SERVER和 _REQUEST都没有?

private $super_globals = array(
'c' => '_COOKIE',
'g' => '_GET',
'p' => '_POST',
'r' => '_REQUEST',
'f' => '_FILES',
);
why cant
$value = & ${$this->super_globals[$var]}[$name];
work ?


EDIT:
Please note that variable variables cannot be used with PHP's Superglobal arrays within functions or class methods. The variable $this is also a special variable that cannot be referenced dynamically.

lol

No comments:

Post a Comment