Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:50930 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 74993 invoked from network); 9 Dec 2010 10:46:59 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 9 Dec 2010 10:46:59 -0000 Authentication-Results: pb1.pair.com smtp.mail=eloybote@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=eloybote@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.83.170 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: eloybote@gmail.com X-Host-Fingerprint: 74.125.83.170 mail-pv0-f170.google.com Received: from [74.125.83.170] ([74.125.83.170:64036] helo=mail-pv0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 48/B2-61607-D93B00D4 for ; Thu, 09 Dec 2010 05:46:57 -0500 Received: by pvf33 with SMTP id 33so554493pvf.29 for ; Thu, 09 Dec 2010 02:46:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type; bh=ZcALN6pqd/o9ESPDHIZxzKWJsG0yBv6TvVYKR7UMlzg=; b=LSoUOG3v3mtk9dquUciSeiKJCyNl0/rfUTLiGlf0C8r3bwl/TBf6LxIuXwl3hsA7M5 3p95fBXjY2kCY1m08W8nNS5fyDemIkVoFzqS5dUiWCqrSdApCGsRcaLtdtv8WRND6ndb hCW4O44JBul2xG+WL/+ThIxksDFQu6xzQcToU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=ucZLnkestCO3l98zJ16F3n7QKzxgEcTYh0LBCD5XqQGGMGf0iZeYn/3pTtK6TPUlbN ka5Xl6KqqXzEkMXjbeLgw15fYWHccfzRAAzpe/6P5DN3efZUjfxYoMlsK6A3DO63uySk tNAv8dz0d/D6bj0/w0WegXVsu9CWgSbhDo0O0= MIME-Version: 1.0 Received: by 10.142.186.10 with SMTP id j10mr3814272wff.350.1291891572615; Thu, 09 Dec 2010 02:46:12 -0800 (PST) Received: by 10.142.173.4 with HTTP; Thu, 9 Dec 2010 02:46:12 -0800 (PST) In-Reply-To: <4D00AE18.9050300@hristov.com> References: <4D00ABFE.5070403@hristov.com> <4D00AD47.8030200@thelounge.net> <4D00AE18.9050300@hristov.com> Date: Thu, 9 Dec 2010 11:46:12 +0100 Message-ID: To: Andrey Hristov Cc: PHP Internals List Content-Type: multipart/alternative; boundary=000e0cd28c58462c390496f7f2e5 Subject: Re: [PHP-DEV] Deprecating "global" + $GLOBALS, making $_REQUEST, $_GET, $_POST read-only From: eloybote@gmail.com (Eloy Bote Falcon) --000e0cd28c58462c390496f7f2e5 Content-Type: text/plain; charset=ISO-8859-1 2010/12/9 Andrey Hristov > Reindl Harald wrote: > >> Please do not >> >> global + GLOBALS can be used in so many ways and you would break >> 200.000 LOC only here which is running with reporting E_STRICT >> in a production environment >> > > what happened after register_globals was introduced and registering of > globals was switched off? > > > The same for making $_GET/$_POST/$_REQUEST readonly >> I know that it is not best practice, but sometimes >> it makes life easier to fetch $_POST in a method >> which overwrites a parent method and add a single >> item before the parent is processing $_POST >> > > It's bad practice. > > > Yes, there are many other ways to do the same but >> BC-breaking trigger a lot of work and testing >> >> Am 09.12.2010 11:14, schrieb Andrey Hristov: >> >>> Hi guys, >>> the topic says most of it. What do you think about deprecating the global >>> keyword and $GLOBALS with it? Together >>> with this making $_REQUEST, $_GET and $_POST read-only as they should be >>> used only to read-only anyway. >>> >>> The reason for global + GLOBALS is that these are abused and which leads >>> to spaghetti programs, when used by >>> unexperienced users. Also they have impact on side effects from functions >>> that don't only rely their parameters. >>> >>> Best, >>> Andrey >>> >> >> >> > Best, > Andrey > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > Is copying the POST variables into another variables best practice (like a manual register_globals)? In the global scope of the application I think it's cleaner to work with $_POST to overwrite the values than copying the items into variables. Inside a function/method, I agree that it's best practice to pass $_POST as a parameter and then overwrite the values as you need. Regards, Eloy Bote Falcon. --000e0cd28c58462c390496f7f2e5--