Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:33192 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 95057 invoked by uid 1010); 17 Nov 2007 02:09:19 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 95042 invoked from network); 17 Nov 2007 02:09:19 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Nov 2007 02:09:19 -0000 Authentication-Results: pb1.pair.com header.from=michaelm@swplumb.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=michaelm@swplumb.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain swplumb.com from 209.181.81.165 cause and error) X-PHP-List-Original-Sender: michaelm@swplumb.com X-Host-Fingerprint: 209.181.81.165 mail.swplumb.com Windows XP Pro SP1, 2000 SP3 Received: from [209.181.81.165] ([209.181.81.165:1623] helo=swplumb.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 6A/E6-51194-E4D4E374 for ; Fri, 16 Nov 2007 21:09:19 -0500 Received: from michael-ms-computer.local [192.168.2.66] by swplumb.com with ESMTP (SMTPD-9.22) id AC300208; Fri, 16 Nov 2007 19:04:32 -0700 Message-ID: <473E4D4B.6040403@swplumb.com> Date: Fri, 16 Nov 2007 19:09:15 -0700 User-Agent: Thunderbird 2.0.0.9 (Macintosh/20071031) MIME-Version: 1.0 CC: Stanislav Malyshev , internals@lists.php.net References: <8D.46.01128.768AD374@pb1.pair.com> <1195246391.21084.15.camel@sbarrow-desktop> <1195250285.4012.6.camel@johannes.nop> <1195251014.21084.20.camel@sbarrow-desktop> <473E349E.3050704@swplumb.com> <473E35A3.3010307@zend.com> <1195259911.10547.9.camel@sams-room> In-Reply-To: <1195259911.10547.9.camel@sams-room> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Re: Question about superglobals From: michaelm@swplumb.com (Michael McGlothlin) 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: > >>> I 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. >> > > -- Michael McGlothlin Southwest Plumbing Supply