Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:50966 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 59962 invoked from network); 9 Dec 2010 17:05:23 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 9 Dec 2010 17:05:23 -0000 Authentication-Results: pb1.pair.com header.from=keisial@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=keisial@gmail.com; spf=pass; sender-id=pass 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:35434] helo=mail-ew0-f45.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 8D/F4-32270-F4C010D4 for ; Thu, 09 Dec 2010 12:05:21 -0500 Received: by ewy10 with SMTP id 10so1893338ewy.32 for ; Thu, 09 Dec 2010 09:05:15 -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=+7Cl+LkEy9qdcUrmtRSgYw7ENBd9LL5B71dRYWR6SM4=; b=AOpkZkNjrwexy+iCM4uYVE6emqVyKoMMQAyxLwjy4jB3U2rbm7fZxe9UNE3AAoJ3o+ StXc49SuxrMQl6VoGpNZnvPH4IccIdpPhvFBP2exdGfNlnDpKpm4YepDPdT2OnKkP5Dj BL1mL4LjX5uzttcOVmwaJH6T4pdA7HDFdno/U= 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=HWNiXjZsAoHzz7+6Vx4mS1th5uiZrbjAzsBLt7XF9fJbj71iRL84PuaJlCX276yCp7 PFkRbpl8vCS17HEPpKscyKSKD3LfnX4pHzbFrWEHmCiQQgiqQ2AjjYBt0mp4xODLPPvJ 1k/6qkhMPiqDbAfSWvqA0phxYcg+wazCO6s5g= Received: by 10.216.162.3 with SMTP id x3mr2285569wek.18.1291914315617; Thu, 09 Dec 2010 09:05:15 -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 p4sm989174wej.4.2010.12.09.09.05.13 (version=SSLv3 cipher=RC4-MD5); Thu, 09 Dec 2010 09:05:14 -0800 (PST) Message-ID: <4D010C88.5010209@gmail.com> Date: Thu, 09 Dec 2010 18:06:16 +0100 User-Agent: Thunderbird MIME-Version: 1.0 To: Andrey Hristov , PHP Developers Mailing List References: <4D00ABFE.5070403@hristov.com> <4D00C86D.70208@hristov.com> <4D00FFDD.7040107@gmail.com> <4D01011B.4090608@hristov.com> In-Reply-To: <4D01011B.4090608@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: > Ángel González wrote: >> So how do you support global variables by banning the two ways they can >> be accessed? > > very easy, by using them by name. Global variables are those outside > of a classes, methods and functions. If they can only be used outside functions they would be more restricted that eg. class variables. >> 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. >> > And in all possible places TSRMLS_FETCH() is being thrown out and > replaced with TSRMLS_DC. You can check the commits to see this. If all > functions were getting the ID of the thread context one could have > have different than 1:1 mapping of request and OS threads - check the > thread scheduler of MySQL 5.1 and 5.5. > > Andrey As I said, that's a fine goal. There are more than 400 calls to TSRMLS_FETCH() in the release tarball. Not all of them can be changed with a TSRMLS_DC. Furthermore, the php project would be unhappy and broken if one of the supported OS decided to remove all kinds of thread local storage support (even thread ids!), on the basis of "being a bad design".