Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:50951 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 37329 invoked from network); 9 Dec 2010 16:11:18 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 9 Dec 2010 16:11:18 -0000 Authentication-Results: pb1.pair.com smtp.mail=keisial@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=keisial@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.215.45 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: keisial@gmail.com X-Host-Fingerprint: 209.85.215.45 mail-ew0-f45.google.com Received: from [209.85.215.45] ([209.85.215.45:60636] helo=mail-ew0-f45.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 8D/60-32270-4AFF00D4 for ; Thu, 09 Dec 2010 11:11:18 -0500 Received: by ewy10 with SMTP id 10so1829180ewy.32 for ; Thu, 09 Dec 2010 08:11:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=whMP/ChLJ6ELg8vVDWlTCZP15bJSj1yAkQMTxe1WStw=; b=myqTTNhz+8mGbZXfJ7FOk2FBh7FjTfRlgytqZMgTxQoDhfQMfD7aTHA5KkZ1+ewycr vLSTRT46ygEMyN8dR8wK7JuKxPAet2RT3miyRvawRD7C3x4XuHHAdGc+rCNq+C5CQrnM FA0OwRI++RfQ9cI+PN+aVajRy29i4afOnH1Uo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=lUoDLanXxLjjsT00QOpE97BKEljybTK/8sti4j1nPQov7R5PCrb+gAZNTO46dcvcaQ EqFRkSdM2s3wOr2JyO+CfxxrDOcWYCBOvKB/lD0AK1OvLXGK9zjGO3ni1CBBQt1xtlV1 K4HaeHW63uKpUKAeCFh8qxzcPU54zYLUFfKj4= Received: by 10.216.46.193 with SMTP id r43mr791891web.20.1291911073483; Thu, 09 Dec 2010 08:11:13 -0800 (PST) Received: from [192.168.1.26] (143.red-80-28-66.adsl.dynamic.ccgg.telefonica.net [80.28.66.143]) by mx.google.com with ESMTPS id k4sm959120weq.9.2010.12.09.08.11.11 (version=SSLv3 cipher=RC4-MD5); Thu, 09 Dec 2010 08:11:12 -0800 (PST) Message-ID: <4D00FFDD.7040107@gmail.com> Date: Thu, 09 Dec 2010 17:12:13 +0100 User-Agent: Thunderbird MIME-Version: 1.0 To: Andrey Hristov , PHP Developers Mailing List References: <4D00ABFE.5070403@hristov.com> <4D00C86D.70208@hristov.com> In-Reply-To: <4D00C86D.70208@hristov.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: Re: [PHP-DEV] Deprecating "global" + $GLOBALS, making $_REQUEST, $_GET, $_POST read-only From: keisial@gmail.com ("=?UTF-8?B?w4FuZ2VsIEdvbnrDoWxleg==?=") Andrey Hristov wrote: > I am not against global variables, I'm against usage of $GLOBALS and > "global". So how do you support global variables by banning the two ways they can be accessed? -1 >> From a Framework point of view, they should save all of the >> (super)global variables from the global scope, because the frameworks >> doesn't use/run code in the global scope except the bootstrap, so >> they couldn't access that either, but they won't know what the >> developer who uses the framework want's to access from the global scope. >> And what about global constants? They are also screwing up the >> Dependency Injection, and the static functions/properties, and the  >> singletons also.  Should we ban those? > > no, you got me wrong. I will repeat - global variables won't cease to > exist, but $GLOBALS and "global" as means to access them should be > removed. If a function needs data it should get it passed to it. That's like trying to forbid TSRMLS_FETCH() in php source saying "just use TSRMLS_DC instead". Sure it is a nice goal but a) That's not always feasible [without rewriting an insane amount of code] b) It's not a restriction that should be imposed by the language.