Re: Re: Question about superglobals
| From: | Michael McGlothlin | Date: | Sat, 17 Nov 2007 02:09:15 +0000 |
| Subject: | Re: Re: Question about superglobals | ||
| References: | 1 2 3 4 5 6 7 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-33192@lists.php.net to get a copy of this message | ||
PHP needs more options for both tighter and looser control of variables. I could use an extra superglobal here and there but I also suggested recently, without response, a way to make variables local to a chunk of code without it needing to be a function. Both would be useful in the right conditions - conditions that come up quite often in large programs.
Well this is very common with PHP, it's very flexible and it's easy for a bad programmer to create chaotic code and get away with it, but this can happen with many features of PHP. For serious developers however, this could prove to be very useful when used appropriately. People will do what they will and make sloppy programs, but that's completely up to them. No point in holding stuff back from people who could benefit from it just to protect inexperienced them from their own sloppiness. You know what I mean? On Fri, 2007-11-16 at 16:28 -0800, Stanislav Malyshev wrote:-- Michael McGlothlin Southwest Plumbing SupplyI think the superglobal keyword is a great idea. I have a custom class that implements a custom interface to memcache with a MySQL backend for data that drops out of memcache or is to big to be stored easily in memcache. I get annoyed at needing to include a global statement in every place I want to use memcache.I don't think it's a good idea. Superglobals are special for a reason - if everybody would just add stuff into global space and make it superglobal because they can't type a couple of keystrokes, it would be a mess. Just declare a class and use statics or singletons.