#24547 [Com]: can't send name of global array as function parameter
| From: | spaze at exploited dot cz | Date: | Tue, 08 Jul 2003 20:53:08 +0000 |
| Subject: | #24547 [Com]: can't send name of global array as function parameter | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-43483@lists.php.net to get a copy of this message | ||
ID: 24547
Comment by: spaze at exploited dot cz
Reported By: nn at rtfm dot cz
Status: Open
Bug Type: Variables related
Operating System: Linux Debian
PHP Version: Irrelevant
New Comment:
workaround - this way it works, but..
function foo($type='_GET') {
global $$type; // note this
print_r($$type);
}
looks like a "superglobal access" problem?
Previous Comments:
------------------------------------------------------------------------
[2003-07-08 15:49:11] jf at rtfm dot cz
wtf php?
------------------------------------------------------------------------
[2003-07-08 15:42:22] nn at rtfm dot cz
Description:
------------
I think that this is a bug, see the code, it is self-explaining :-)
Reproduce code:
---------------
function xx ($type = '_POST') {
echo '<pre>'; print_r($$type); echo '</pre>';
}
xx();
Expected result:
----------------
I expect to see my $_POST variables! :-)
Actual result:
--------------
Notice: Undefined variable: _POST in
/www/album.cz/www/album/registrace/index.php on line 31
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=24547&edit=1