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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
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: Mon May 06 15:01:31 2024 UTC