Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:100117 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 89808 invoked from network); 30 Jul 2017 00:19:03 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 30 Jul 2017 00:19:03 -0000 Authentication-Results: pb1.pair.com header.from=smalyshev@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=smalyshev@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.192.182 as permitted sender) X-PHP-List-Original-Sender: smalyshev@gmail.com X-Host-Fingerprint: 209.85.192.182 mail-pf0-f182.google.com Received: from [209.85.192.182] ([209.85.192.182:33386] helo=mail-pf0-f182.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 60/22-07025-5F52D795 for ; Sat, 29 Jul 2017 20:19:02 -0400 Received: by mail-pf0-f182.google.com with SMTP id d67so40237727pfc.0 for ; Sat, 29 Jul 2017 17:19:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=ekEBpxBQ4llzl1b6u793HSNKVAHNgr+ndv+02ckGwbM=; b=GiE9fTikrMkfieJTjvb6UL1NHypi2lblewF1kc6JArlahsDD7I2/hRouasYrnYjEW7 5xIyn8ue71m6kcrsjBxXGPzqBF8LLAuDPCT2gTCjJ4gANIx7T+XZQZACRsN851sm2mZo BpDMCPs73643HpPXukoQccyBZq8aF8w1h8IRltoz30oCUqtAewVXSBrjc3fMH1RqVT7N swWRft6kHZPMgb8mUSaxkGNZ9Gwx/laKC/iHWKn2+0VpNiZMLqtClbV9VfY4iDLjaPW4 9aWHuqRjMZlOt7tBpbUG384vXGbIPfPS9e/+GaerlnoSyM8YwczLMypPhc2afk+qPBol R4Jw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=ekEBpxBQ4llzl1b6u793HSNKVAHNgr+ndv+02ckGwbM=; b=A/JFXH3jVqkOOZ7QUzw8uxdkxsgnI29kykXNlS6zv4jgj63os/vEWzLK9Yod6VD7Tj 1v3NByzQQArcNuD3N+Lxp6avYpkdCOR7qZkahp5/mqeaeL69CbXcuJRwpgD1UJ3n1lWc J/d6h2EqP0iu/EiOwxZ23mp+f8NcZIY04TVf754r8NxfRKTuatlv26+MJ9a2lfEMLmpD QD/1/QQYfRuO3Eb82kK2oskqqYJT32zmVeDkd+ZRuBAaJGnaWANAqMLbduzj5Hf/bz/C pXlfItvrmBXGg1F2SdbkD8c7QCII38oYecKcDXAQcvykpRdhZG7vFqnCPkcJY6v8nKpv ON/w== X-Gm-Message-State: AIVw113Tk00KhJezL3zVyNbxqBKEQvSFe6friAmZUOxHvPNqwdIa8ypi mO4xTjM7BO/99vikPno= X-Received: by 10.84.209.165 with SMTP id y34mr12305284plh.396.1501373937735; Sat, 29 Jul 2017 17:18:57 -0700 (PDT) Received: from ?IPv6:2602:306:ce9c:e680:f4a8:eba3:734e:a7d6? ([2602:306:ce9c:e680:f4a8:eba3:734e:a7d6]) by smtp.gmail.com with ESMTPSA id r64sm49075275pfj.62.2017.07.29.17.18.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 29 Jul 2017 17:18:56 -0700 (PDT) To: Kalle Sommer Nielsen Cc: Sara Golemon , PHP internals References: <12777d61-3277-413b-c60b-12c8c75bd76f@gmail.com> Message-ID: Date: Sat, 29 Jul 2017 17:18:56 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Changes to SuperGlobals for PHP 8 From: smalyshev@gmail.com (Stanislav Malyshev) Hi! > Sure it seems useful, but I see it more as a hack if you are just > writing to superglobals anyway, if you need to change something you > should do that with your own logic instead. That's what I said - you can always add a layer of indirection. But why? What is so sacred in those variables that writing into them is taboo and writing into intermediate layer is OK? > If its something simple such as your code assumes $_GET['id'] always > is available, then either write it to a temp variable. Again, could do it, but why? What is so special in '_GET' that is not in temp variable? Why make me do extra work? > I know many applications nowadays are not written with an excess > amount of globals everywhere, but writing to a global without > explicitly declaring you want to, can cause some hard to debug cases > if one function modifies a global and another assumes an unmodified > value. I'd like to see that gone. Request context is a global state. It is a legit global state - everything within the request is executed in the context of the request. If you put this global state into some kind of intermediate layer instead of _GET, you would have absolutely the same global state issues. You can write your app so that it extracts data from global state into local state and does not depend on it, but this has nothing to do with _GET itself - you could do it very well without changing anything with _GET. Changing _GET does not solve the issues if you use global state, and the issues do not exist if you don't. -- Stas Malyshev smalyshev@gmail.com