#19352 [NEW]: can't dynamically access superglobals
| From: | soletan at toxa dot de | Date: | Wed, 11 Sep 2002 09:07:39 +0000 |
| Subject: | #19352 [NEW]: can't dynamically access superglobals | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-19019@lists.php.net to get a copy of this message | ||
From: soletan@toxa.de
Operating system: Linux 2.4.18
PHP version: 4.2.3
PHP Bug Type: *General Issues
Bug description: can't dynamically access superglobals
Hi,
I'm running Apache 2.0.40 with PHP 4.2.3 as DSO.
Within my scripts I realised a problem that I tried to test specially now
with a smaller script.
-----------------------
<?php
$method = "_GET";
echo $$method["id"];
var_dump( $$method );
?>
-----------------------
produces on call with ?id=the+test added to the script's URL
-----------------------
array(1) {
["id"]=>
string(8) "the test"
}
-----------------------
The echo output isn't there. If I try to assign it to some other value it
gets set to NULL.
Is it a general change of PHP's behaviour or any error? Earlier I used
this to reload a form's values, after dynamically creating and arranging
it into some structure. However, that days I used the non-superglobal
$HTTP_GET|POST_VAR ... this is obsolete, isn't it? And that's why I won't
get back to use it any further ...
--
Edit bug report at http://bugs.php.net/?id=19352&edit=1
--
Try a CVS snapshot: http://bugs.php.net/fix.php?id=19352&r=trysnapshot
Fixed in CVS: http://bugs.php.net/fix.php?id=19352&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=19352&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=19352&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=19352&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=19352&r=support
Expected behavior: http://bugs.php.net/fix.php?id=19352&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=19352&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=19352&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=19352&r=globals