Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:33215 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 54428 invoked by uid 1010); 17 Nov 2007 06:50:06 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 54412 invoked from network); 17 Nov 2007 06:50:05 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Nov 2007 06:50:05 -0000 Authentication-Results: pb1.pair.com header.from=robert@interjinn.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=robert@interjinn.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain interjinn.com from 66.11.173.122 cause and error) X-PHP-List-Original-Sender: robert@interjinn.com X-Host-Fingerprint: 66.11.173.122 unknown Received: from [66.11.173.122] ([66.11.173.122:57302] helo=blobule.interjinn.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E4/10-51194-C1F8E374 for ; Sat, 17 Nov 2007 01:50:05 -0500 Received: by blobule.interjinn.com (Postfix, from userid 2000) id 589985AD15D; Sat, 17 Nov 2007 01:50:02 -0500 (EST) To: Sam Barrow Cc: Rasmus Lerdorf , internals@lists.php.net In-Reply-To: <1195281606.12249.69.camel@sams-room> References: <8D.46.01128.768AD374@pb1.pair.com> <473E6F38.4020008@lerdorf.com> <1195274394.12249.34.camel@sams-room> <200711162354.34489.larry@garfieldtech.com> <1195279274.12249.40.camel@sams-room> <1195279545.12249.47.camel@sams-room> <473E87C5.4090200@lerdorf.com> <1195280474.12249.60.camel@sams-room> <1195281053.1702.8.camel@blobule> <1195281606.12249.69.camel@sams-room> Content-Type: text/plain Content-Transfer-Encoding: 7bit Organization: InterJinn Date: Sat, 17 Nov 2007 01:50:01 -0500 Message-ID: <1195282202.1702.13.camel@blobule> Mime-Version: 1.0 X-Mailer: Evolution 2.10.1 Subject: Re: [PHP-DEV] Re: Question about superglobals From: robert@interjinn.com (Robert Cummings) On Sat, 2007-11-17 at 01:40 -0500, Sam Barrow wrote: > I don't understand, people keep telling me this can cause problems so > it's trash. Really? Functions and variables can cause problems too. Not > to mention user input. Programming is not easy, but the more flexible it > is the better. I think it's up to the programmer to keep track of his > variables, rather than us limiting his functionality, just incase he > makes a mistake. > > Any programmer can write bad code and it won't work. If he uses > superglobals he should understand that he needs to document them, it's > that simple. If that's too difficult, don't create a superglobal then, > great. > > And if this isn't good enough, fine. Require an underscore for > superglobals to differentiate them even more. I'll write the code > myself, no problem. This isn't the same issue as functions and classes residing in the same global namespace. This is a problem with a single declaration affecting variables having the same name in EVERY scoping context. If you redefine a function --> ERROR If you redefine a class --> ERROR If you define a super global named $cfg --> NO ERROR, NO WARNING, NO NOTICE GLOBAL CLOBBERING of ALL variables names $cfg in global scope, local function scope, class method scope. That's one hell of a problem to track down to save a few lazy people some keystrokes that in their naivety they think is for the greater good. Cheers, Rob. -- ........................................................... SwarmBuy.com - http://www.swarmbuy.com Leveraging the buying power of the masses! ...........................................................