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
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: phpbugs at thequod dot de
New email:
PHP Version: OS:

 

 [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

Pull Requests

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-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 22 16:01:31 2024 UTC