php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #38527 Allow using superglobals as variable-variables
Submitted: 2006-08-20 20:27 UTC Modified: 2011-08-23 16:51 UTC
Votes:1
Avg. Score:4.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: phpbugs at thequod dot de Assigned:
Status: Wont fix Package: *General Issues
PHP Version: 5CVS-2006-08-20 (CVS) OS: Ubuntu Linux
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2006-08-20 20:27 UTC] phpbugs at thequod dot de
Description:
------------
The superglobals cannot get used as "variable-variables" 
in a function.

This is documented here: 
http://www.php.net/manual/en/language.variables.variable.php

Therefor this is a feature request, to change this.

Reproduce code:
---------------
$g = '_GET';
var_dump( $$g );

function f() {
  $g = "_GET";
  var_dump($$g);
}

f();


Expected result:
----------------
array(0) {
}
array(0) {
}


Actual result:
--------------
array(0) {
}

Notice: Undefined variable: _GET in X
NULL


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-08-23 16:51 UTC] laruence@php.net
-Status: Open +Status: Wont fix -Package: Feature/Change Request +Package: *General Issues
 [2011-08-23 16:51 UTC] laruence@php.net
Mark as won't fix, see #55493
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Wed Dec 01 19:03:37 2021 UTC