Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:50969 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 65203 invoked from network); 9 Dec 2010 17:09:37 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 9 Dec 2010 17:09:37 -0000 Authentication-Results: pb1.pair.com smtp.mail=php@hristov.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=php@hristov.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain hristov.com from 85.92.87.36 cause and error) X-PHP-List-Original-Sender: php@hristov.com X-Host-Fingerprint: 85.92.87.36 iko.gotobg.net Linux 2.6 Received: from [85.92.87.36] ([85.92.87.36:37245] helo=iko.gotobg.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 90/36-32270-05D010D4 for ; Thu, 09 Dec 2010 12:09:36 -0500 Received: from [77.0.224.33] (helo=[192.168.1.100]) by iko.gotobg.net with esmtpa (Exim 4.69) (envelope-from ) id 1PQjze-00029I-EV; Thu, 09 Dec 2010 19:09:22 +0200 Message-ID: <4D010D49.5070309@hristov.com> Date: Thu, 09 Dec 2010 18:09:29 +0100 User-Agent: Thunderbird 2.0.0.24 (X11/20100411) MIME-Version: 1.0 To: =?UTF-8?B?w4FuZ2VsIEdvbnrDoWxleg==?= CC: PHP Developers Mailing List References: <4D00ABFE.5070403@hristov.com> <4D00C86D.70208@hristov.com> <4D00FFDD.7040107@gmail.com> <4D01011B.4090608@hristov.com> <4D010C88.5010209@gmail.com> In-Reply-To: <4D010C88.5010209@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - iko.gotobg.net X-AntiAbuse: Original Domain - lists.php.net X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - hristov.com X-Source: X-Source-Args: X-Source-Dir: Subject: Re: [PHP-DEV] Deprecating "global" + $GLOBALS, making $_REQUEST, $_GET, $_POST read-only From: php@hristov.com (Andrey Hristov) Ángel González wrote: > 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". > interesting comparison of global variables with local data (thread local storage) Andrey