php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #33409 User-defined superglobals
Submitted: 2005-06-20 20:33 UTC Modified: 2005-06-20 20:51 UTC
From: graced at monroe dot wednet dot edu Assigned:
Status: Not a bug Package: Feature/Change Request
PHP Version: 5.0.4 OS: Linux 2.4.21 (RHAS3)
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: graced at monroe dot wednet dot edu
New email:
PHP Version: OS:

 

 [2005-06-20 20:33 UTC] graced at monroe dot wednet dot edu
Description:
------------
This is related to bug #18060, which is marked as "Won't fix", but I'd like to add some input to it and can't.

It would be nice to have a programming construct that turns a regular variable into a superglobal along the same lines as $_GET/$_REQUEST/$_POST/$_SERVER/etc.

I have a large project that has a 'configuration' stored in the global $CFG.  Having to global this (or type $GLOBALS['CFG']) every time it needs to be checked inside one of a multitude of functions is very time consuming.

I'd rather be able to write:

superglobal $CFG;

just once, since it's much cleaner than having to remember to global it everywhere.



If it's the programmer's discretion as to whether a variable is a superglobal (rather than all variables being 'superglobal' like in some other languages) it should avoid   the "nasty global variable side-effects" that other languages are prone to 


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-06-20 20:51 UTC] derick@php.net
Please do not submit the same bug more than once. An existing
bug report already describes this very problem. Even if you feel
that your issue is somewhat different, the resolution is likely
to be the same. 

Thank you for your interest in PHP.

If one is marked as \"Won\'t fix\" why are you repeating the report? Obviously we\'re not going to do it now either... 
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 26 04:01:30 2024 UTC