Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:27932 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 10554 invoked by uid 1010); 9 Feb 2007 01:43:36 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 10538 invoked from network); 9 Feb 2007 01:43:36 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 9 Feb 2007 01:43:36 -0000 Authentication-Results: pb1.pair.com header.from=cschneid@cschneid.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=cschneid@cschneid.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain cschneid.com from 195.226.6.51 cause and error) X-PHP-List-Original-Sender: cschneid@cschneid.com X-Host-Fingerprint: 195.226.6.51 darkcity.gna.ch Linux 2.5 (sometimes 2.4) (4) Received: from [195.226.6.51] ([195.226.6.51:44172] helo=mail.gna.ch) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 0B/24-11345-6C1DBC54 for ; Thu, 08 Feb 2007 20:43:35 -0500 Received: from localhost (localhost [127.0.0.1]) by darkcity.gna.ch (Postfix) with ESMTP id E52AFBADE1; Fri, 9 Feb 2007 02:43:31 +0100 (CET) Received: from unknown by localhost (amavisd-new, unix socket) id client-XXlY8J1a; Fri, 9 Feb 2007 02:43:29 +0100 (CET) Received: from [192.168.1.42] (217-162-171-242.dclient.hispeed.ch [217.162.171.242]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by darkcity.gna.ch (Postfix) with ESMTP id 0FBD3BA996; Fri, 9 Feb 2007 02:43:28 +0100 (CET) Message-ID: <45CBD1C0.9080905@cschneid.com> Date: Fri, 09 Feb 2007 02:43:28 +0100 User-Agent: Thunderbird 1.5.0.9 (Macintosh/20061207) MIME-Version: 1.0 To: Guilherme Blanco CC: internals@lists.php.net References: In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: amavisd-new at gna.ch Subject: Re: [PHP-DEV] Suggestion: global variables being accessed in localscope From: cschneid@cschneid.com (Christian Schneider) Guilherme Blanco wrote: > Brian,I am sorry about the message indentation... Seems PHP-Internals > list does not like M$ Live(r) Mail! Please use plain text mail as your messages are a PITA to read, thanks. > you can see, the only change needed is in a throw-able error (Undefined > variable), which does a second look-up in the symbolTable.Doing > this, you do not need to use $GLOBALS nevermore! And also, global can You didn't grasp two of the major PHP features (not bugs!): 1. Every variable you access inside a function is local unless explicitely imported (through $GLOBALS, global or superglobals) from the global scope. 2. Accessing undefined variables is normal and not an error (not everybody agrees here but lots of people consider this a big plus). Changing this would turn PHP into a completely different language so it's simply not going to happen. If you don't like these basic concepts it's probably a good idea to switch language. Regards, - Chris