php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #19352 can't dynamically access superglobals
Submitted: 2002-09-11 04:07 UTC Modified: 2002-09-11 08:44 UTC
From: soletan at toxa dot de Assigned:
Status: Not a bug Package: *General Issues
PHP Version: 4.2.3 OS: Linux 2.4.18
Private report: No CVE-ID: None
 [2002-09-11 04:07 UTC] soletan at toxa dot de
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 ...

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Tue Oct 06 18:00:01 2026 UTC