Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:101907 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 10712 invoked from network); 23 Feb 2018 13:47:18 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Feb 2018 13:47:18 -0000 Authentication-Results: pb1.pair.com smtp.mail=marijic.silvio@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=marijic.silvio@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.220.170 as permitted sender) X-PHP-List-Original-Sender: marijic.silvio@gmail.com X-Host-Fingerprint: 209.85.220.170 mail-qk0-f170.google.com Received: from [209.85.220.170] ([209.85.220.170:33291] helo=mail-qk0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E0/D4-01511-56B109A5 for ; Fri, 23 Feb 2018 08:47:18 -0500 Received: by mail-qk0-f170.google.com with SMTP id f25so10804859qkm.0 for ; Fri, 23 Feb 2018 05:47:17 -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 :cc; bh=KOsJ9UuyH5QEAp+S36i604US4iCVugdu+WmF6D9kcJY=; b=ducnctIGCawks69wJKqZBJa+hShSI/fCpxudwSpBwAC+bucOY7AkgLxtkT+B/jTZgC mbD6C5Xs/uvzStT93KJcrgLGzMZ9z1ngogsMTE0H7iLEfeirwGXssOeolGUcJTC9uH4i 4byAmwsbZ3TAW5GtDMbtblurZwwm+NJk8hbj2FCfY6MgJKvmp2fRQpYCFIShrgHeJ3ZT EAi1prDtWV9gulDGHeXmJO2m1Nl9cSZ9gZ1EotHRuPICfJFFlxXNlUtxADaZyQj/DxKJ kdijhSrSMVSbpcX3y6GpqarZ0euS36Yg0xWao8gri+gSSipDMfMhnKl+1f1DMo8Fzsby kf4A== 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=KOsJ9UuyH5QEAp+S36i604US4iCVugdu+WmF6D9kcJY=; b=OaKK3//nWGysFQOwQprqoxwAhCmtL5yL4mwwIh1Rbnl0FtpezOjH6WxLdN9Dtf9/Fv w86dkgS9yBopssd/bVjALCJ3ONug9Dg+ZfkIXzRC7DesZmeaibyK8Ca5UcLLcbp1q6DB 9/pJTYYAfSAxwj5FP8IeFli/64zokfmps1Pkt6ZkB7WXkHFWXS41taam/r/pOpxu9XbZ pGyiQ6ffAwstbmXiW1goos721Em5shbkBmy4p43B9ogIB2o7lBpLEbDBtCi1AFtqfHq3 ZyySdS/1ajcUWjNPYiAxDtjFM98lYa3L4aGzQMts/EHoYwIlxsrAIEG/Pj6AZD8LsDvU 4xZg== X-Gm-Message-State: APf1xPBoJe2XL2gnxNIMv5xS21i89YOwoFMXV5lKdcdS+062+stIONrD CbOxbZlkZPvWycnlTQusQFsfNG3sQe/XzFDOrR4= X-Google-Smtp-Source: AG47ELtCf2s5hJQ+Fb4Ki5P4cFMDLGjK9hHVZLIiBAGd8gW9YMYoKWfbZqwc6l8NDDpJ82nPZTJix5M1ifnfGxRYkKY= X-Received: by 10.55.141.67 with SMTP id p64mr2430478qkd.43.1519393635281; Fri, 23 Feb 2018 05:47:15 -0800 (PST) MIME-Version: 1.0 Received: by 10.140.33.133 with HTTP; Fri, 23 Feb 2018 05:47:14 -0800 (PST) In-Reply-To: References: Date: Fri, 23 Feb 2018 14:47:14 +0100 Message-ID: To: Rowan Collins Cc: PHP Internals List Content-Type: multipart/alternative; boundary="94eb2c084666e7b0c50565e1657c" Subject: Re: [PHP-DEV][RFC][DISCUSSION] Immutability From: marijic.silvio@gmail.com (=?UTF-8?Q?Silvio_Mariji=C4=87?=) --94eb2c084666e7b0c50565e1657c Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable In addition to your question about impact on the performance, there is none. As there is no special tracking of those references just control check when you try to write by reference. 2018-02-23 14:40 GMT+01:00 Silvio Mariji=C4=87 : > Hi Rowan, > > I agree that RFC needs a bit refinement which I hope to do during ongoing > discussion here. > Originally you couldn't assign following types to an immutable property > > - *Resource* > - *Instance of none-immutable class * > > Now I had to resort to also add *array* to that list. > > > Regarding your question about references, yes you can obtain reference to > an immutable property but you can not modify that property by reference. = In > that case it will throw fatal error, but I agree that it would be better = to > throw exception, I will include that in RFC. > > Thanks for the support I really appreciate it. > > Regards, > > 2018-02-22 10:57 GMT+01:00 Rowan Collins : > >> On 20 February 2018 at 11:25, Nikita Popov wrote: >> >> > On Tue, Feb 20, 2018 at 12:20 PM, Silvio Mariji=C4=87 < >> marijic.silvio@gmail.com >> > > >> > 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 botto= m >> of >> > > 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 jus= t >> reiterating things said elsewhere in the RFC, but could maybe be reworde= d? >> >> > 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 take= n >> 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 propertie= s >> 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 R= FC >> currently just says a fatal error. >> >> As I say, I like the idea, and thanks for working on it. >> >> Regards, >> -- >> Rowan Collins >> [IMSoP] >> > > > > -- > Silvio Mariji=C4=87 > Software Engineer > SMSGlobal > --=20 Silvio Mariji=C4=87 Software Engineer SMSGlobal --94eb2c084666e7b0c50565e1657c--