Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:100097 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 34191 invoked from network); 29 Jul 2017 10:27:19 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 29 Jul 2017 10:27:19 -0000 Authentication-Results: pb1.pair.com header.from=danack@basereality.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=danack@basereality.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain basereality.com from 209.85.192.169 cause and error) X-PHP-List-Original-Sender: danack@basereality.com X-Host-Fingerprint: 209.85.192.169 mail-pf0-f169.google.com Received: from [209.85.192.169] ([209.85.192.169:36596] helo=mail-pf0-f169.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B5/CB-40376-7036C795 for ; Sat, 29 Jul 2017 06:27:19 -0400 Received: by mail-pf0-f169.google.com with SMTP id z129so64982197pfb.3 for ; Sat, 29 Jul 2017 03:27:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=basereality-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=dPiFx4yPET9vqXvRHSIecaOh9j4UtZDpGo0DVIaNEaw=; b=JUJVS8FnE6nb0qUCQltP2sHBV4XH9woEVGX0m7p05gTGPkVOvURdXupp/0MeHBn+QF BvhJ9A/iMT5Vg+YgBfDvSWzJminn0Pcnaf6ZCM3oor/c1+e1K0NCzEz4TJOjoLEV48Iw X2kj4TeuvSQ23buldAAkc3wPiF2Xa7h3xaoGL45FPInNkRf80e8gQM+H+FVvFMs6ttvb iKGpAu+wtnVglMX2CeEzUDC0KESYhnyax57BxYeFT6mXqVsEAFfrgOrrhxM1SMtuZlmK UeSfFYi66fD57zPgFZnHCCumKB8cpyZuDH53Jxo2He2BaBpzxmIctd8NP16l9K18vXvB NiLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=dPiFx4yPET9vqXvRHSIecaOh9j4UtZDpGo0DVIaNEaw=; b=scGqhDcr0ImvHZB5vIGiKYl13ZS9LBatKFz+ix9xTfUFDtkUo0B6sphCo9tL4t1wSh wCOQC8gYtdNL2vMXy7YomSjamofYEuDrG5Q5TAB7UUJrDf4VcG4Ig55Rlg+U7lEwFvoZ gGZeiBOSQxGbMMahe+HJ5CeWW1xw3gR77DCe8HndTgLNd240c7y3IfLwJ+hx7gI1f7Km E9rthjNEQ7U5c2f6Drh2OfPYcUnCiW/U+sxh9Q0tKeTCsOFof42EMc/hfzeSqvgjBKeP RfqgaZECPUPGVj96cdWXVvnzsPbBBdxWqVAn0QU8bNcI96dWiJAswHhLfPlJ7ARUstmx qLyQ== X-Gm-Message-State: AIVw113Z8aLuQ5W+Wyoz20x6StGU0Q1733vK/RAwWrGeOtC0WoSVszp3 oc4JU1LK5tZBFwSfl+YVQjDpHmo5lY8K X-Received: by 10.84.232.134 with SMTP id i6mr10458233plk.50.1501324035750; Sat, 29 Jul 2017 03:27:15 -0700 (PDT) MIME-Version: 1.0 Received: by 10.100.186.236 with HTTP; Sat, 29 Jul 2017 03:27:15 -0700 (PDT) X-Originating-IP: [77.99.17.151] In-Reply-To: References: Date: Sat, 29 Jul 2017 11:27:15 +0100 Message-ID: To: Sara Golemon Cc: PHP internals Content-Type: text/plain; charset="UTF-8" Subject: Re: [PHP-DEV] Changes to SuperGlobals for PHP 8 (was: something about session_start...) From: danack@basereality.com (Dan Ackroyd) On 28 July 2017 at 16:11, Sara Golemon wrote: > ftr; I'd vote in favor of several BC breaking things to do with autoglobals, among them: > >* Make them objects (though ArrayAccess based for less hostile BC breakage) Why objects? Although these are kind of just about related things they don't require being in a class/interface. Designing classes/interfaces to be correct the first time is a really difficult thing to do, and then maintaining classes/interfaces is hard as any change to a method is a BC break. I feel pretty strongly that 'just' using a set of function to read the data would be the correct thing to do as: i) they are easier to maintain. ii) They allow people to composite them into objects easily. iii) They're simpler to use in code. > I've seen too many codebases abuse GPCER vars as a generic storage > Restricting their mutability would be a win. Or we could just leave the global mutable variables alone, and just introduce the new set of functions to get the original unmodified data, which would be inherently read-only. That allows everyone who wants to move away from mutable state to do so, leaves current applications working, and we can have the lovely-and-not-at-all-depressing "WHY ARE YOU TERRIBLE PEOPLE BREAKING WORKING CODE!!1!" conversation as a separate discussion; one that doesn't get in the way of allowing people who'd prefer to move forward with saner global state. cheers Dan