Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:101899 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 47857 invoked from network); 22 Feb 2018 09:57:12 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 22 Feb 2018 09:57:12 -0000 Authentication-Results: pb1.pair.com header.from=rowan.collins@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=rowan.collins@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.52 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 74.125.82.52 mail-wm0-f52.google.com Received: from [74.125.82.52] ([74.125.82.52:35958] helo=mail-wm0-f52.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 8D/BF-22623-7F39E8A5 for ; Thu, 22 Feb 2018 04:57:12 -0500 Received: by mail-wm0-f52.google.com with SMTP id f3so2566614wmc.1 for ; Thu, 22 Feb 2018 01:57:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=LDnu54ve+w/TjpsKAKaMDhPRPZKv+V1iZ+5qZS3/nAU=; b=dFcaxNxq251sldmhUJKQI2RUE/YvL19esJQfkJ06ZAGz0Rg3O31c3C5mnRzt+7aJ9y Mt13opdZuGWeOebKE09hYX5f/vs6L3Yxc8WgoKRaeDTb7Lg/yEmuva/HpmUhgha1Viu8 CLxAhmHZHjQHAh9VJI/H9JvTh9Kjrvu/hPQn/ntHxMjCJHAmzqha++gwFbSXwXM8zjro 9swxIc6sdfam4iplvIgJWzb9OxT0OoH4gzNh145YGbnmEB/oxvopeG/LjCitPWJ40wvt QTvfG1Hcn0Uk/yIoH+BlX7Lq6Kw8CZ3y/FikOl91S4AJRSjsoB2F+KwucK9z1FOEBoAn nYSw== 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; bh=LDnu54ve+w/TjpsKAKaMDhPRPZKv+V1iZ+5qZS3/nAU=; b=Mx3A+z3dAymSQekbt7xVZe7WufShsq/cmPrzaqDSqjfz6sJ2z2EDA1HhKZOxChhylx fyDMOkz08s/3OHSLlB87Kajz2/VSPSXoMVfuexkJ6jdqUISqjJS9dzm+DM0RizSiLH7o X9qHkDeDN87un+n6NS93+wlOasRdZGeSQwcKK7Bu509o6NcTP8PlhMJGFLrWHYWzni2v Wo19luDlLZmcFeFm8DT4ceiwu3R2O/N1aPfRfQtkO2UpMGUz7e4cTgYUILW8704Qk2kX XMYbqafXdQiFAlyKhUQqWtCWvtIqjyJ9qr1gKrfOCRpFVJk+d4xwoJfFBzfqgHXhV1PO ySAw== X-Gm-Message-State: APf1xPC58kKILceGsFDwFsxwqWiy0uh4yKIs3A7vmSqboTUUnU/QtUr1 jLebr78hcnIQoKP7G4DXScrMLiLkt9NIyrXQLa2aqg== X-Google-Smtp-Source: AH8x224dYNkrdm7RXEdK10Z/LtXuh6NCK7ouSrGKVvGjwLtopKfdM/gg6sMAc8k6i+WmqPT01/slM3VI/OzdkxdmDIA= X-Received: by 10.80.153.110 with SMTP id l43mr8597921edb.245.1519293428835; Thu, 22 Feb 2018 01:57:08 -0800 (PST) MIME-Version: 1.0 Received: by 10.80.153.38 with HTTP; Thu, 22 Feb 2018 01:57:08 -0800 (PST) In-Reply-To: References: Date: Thu, 22 Feb 2018 09:57:08 +0000 Message-ID: To: PHP Internals List Content-Type: multipart/alternative; boundary="f403045c2c2a22a8780565ca11e4" Subject: Re: [PHP-DEV][RFC][DISCUSSION] Immutability From: rowan.collins@gmail.com (Rowan Collins) --f403045c2c2a22a8780565ca11e4 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On 20 February 2018 at 11:25, Nikita Popov wrote: > On Tue, Feb 20, 2018 at 12:20 PM, Silvio Mariji=C4=87 > > wrote: > > > Hi, > > I am starting this discussion again after a year since this RFC was > > created. From discussions with people in the community some suggestions > > came up regarding issues that were main reason that development on this > RFC > > stopped. RFC is updated along with implementation (link at the bottom o= f > > RFC). I'll be more then happy to answer all questions. > > > Link: https://wiki.php.net/rfc/immutability :) This definitely seems like an exciting addition to the language. Some clarifications: This sentence in the RFC is rather confusing, "Any references to objects ... cannot be references to scalars ... or may be ...". I think it's just reiterating things said elsewhere in the RFC, but could maybe be reworded? > Any references to objects passed into an immutable class constructor cannot be references to scalars or may be immutable class instances. A set of bullet points of what types can and can't be assigned to an immutable property might be useful. The example under "references" shows a reference being successfully taken to an immutable property, but then being considered immutable itself. Is there any performance penalty to tracking this extra state? I know references have caused problems in other cases, like the typed properties RFC. What kind of error is produced when you attempt to write to an immutable property? I would expect some sub-class of Error to be thrown, but the RFC currently just says a fatal error. As I say, I like the idea, and thanks for working on it. Regards, --=20 Rowan Collins [IMSoP] --f403045c2c2a22a8780565ca11e4--