Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:101914 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 34281 invoked from network); 23 Feb 2018 19:04:44 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Feb 2018 19:04:44 -0000 Authentication-Results: pb1.pair.com header.from=marijic.silvio@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=marijic.silvio@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.220.176 as permitted sender) X-PHP-List-Original-Sender: marijic.silvio@gmail.com X-Host-Fingerprint: 209.85.220.176 mail-qk0-f176.google.com Received: from [209.85.220.176] ([209.85.220.176:34219] helo=mail-qk0-f176.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 0A/A0-28114-BC5609A5 for ; Fri, 23 Feb 2018 14:04:43 -0500 Received: by mail-qk0-f176.google.com with SMTP id l206so12023039qke.1 for ; Fri, 23 Feb 2018 11:04:43 -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=Kz8efV20XCTuDWg4YPYBcBhFUzGUibdSr3gHIYNiXxo=; b=i7Zt6K9ECSdgidx7C3O50kNBHHkB+6fPFVNjf1ftHBFO6kK8J3qmbZumDXr4UAdNvH mHxea1Aa+Sg629V5o0Ekyi7Ve9Dw2PPQkwguP/QtUUJ+ekf3oo1kgBNa0myj35/qsIPE erXfIupZ8cw6PQ6h4wFUoYXJ1RaQvE/vgoU2NlTJ9UoR6/urMeTQqDBvaZwpate+ZIA6 zG/cDEt/956M9tmU7q69cedmXZA3oZ4A7lGyNFThytZUH42G+ov2y8F9Hc75TdjmOXjQ IG+NkY7INJFCmgTSbTPObe7mn9Y+sU3LlVpjKfFZXLa7MbbUpParcvo/R7OYvqgTEuAC FMXg== 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=Kz8efV20XCTuDWg4YPYBcBhFUzGUibdSr3gHIYNiXxo=; b=KTXOy8AJHYP78t/4QRrW6I0Brk4YnQBrP+8nhe6ICSlrDdJUu+r8Brzfrrb0dYzJXP ZxzG/LJ9r76sj0F6Wj79ncABOKuncWBIbOvl3fTI21PFKr3DEjbI4IaYCL31IVBykhil S45lIGrT9waV6olYTOW+O9UwV4kG8SOCEPT+Z7tTeOVifxae/DCjEfj2TKnx3NikjCcY lDdEHRPQNt8uMFYu3kHBbXLsdKAX4lahU9eedeuOTOHVnry/VcE9uxzZaR9pPz957lTK rksuyQNkQB9xMghjD9wxQ2VylQsURk60DDtPtVA/vPu+2TO8xs4bmxruhTG3UF+KWOVN iClA== X-Gm-Message-State: APf1xPBvSGCCtPqFW3hJywGDhEcb3E6uwYYRbvS4MUUc5Ax11badAO0j S0SMo8NMcNpO7WYCLzmwtwVuU8T8cTpDFtZKlvM= X-Google-Smtp-Source: AG47ELsySwzg/b6tgXe2mo+ma59UaFUcQ7h1TR8kPF3l6yI3vU9aoVu2YuPbDGgmLbfKAM0iqde4GBDb74umVhTHpu8= X-Received: by 10.55.18.135 with SMTP id 7mr4231173qks.7.1519412680594; Fri, 23 Feb 2018 11:04:40 -0800 (PST) MIME-Version: 1.0 Received: by 10.140.33.133 with HTTP; Fri, 23 Feb 2018 11:04:40 -0800 (PST) In-Reply-To: References: <2B23EFFB-21C3-49E4-9000-B2E0F97E93A2@gmail.com> Date: Fri, 23 Feb 2018 20:04:40 +0100 Message-ID: To: Niklas Keller Cc: Paul Jones , PHP Internals List Content-Type: multipart/alternative; boundary="001a1135d3f21819d00565e5d576" Subject: Re: [PHP-DEV][RFC][DISCUSSION] Immutability From: marijic.silvio@gmail.com (=?UTF-8?Q?Silvio_Mariji=C4=87?=) --001a1135d3f21819d00565e5d576 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable I agree that for any real world applications it wouldn't affect performance, I just didn't want to leave any holes in implementation. Ill test couple of solutions for arrays to see how it works. Yeah, checks are also in place for multiple constructor calls. Regarding your suggestion to draft RFC for passing by value of immutable objects, I am up for that if this RFC passes voting. 2018-02-23 19:23 GMT+01:00 Niklas Keller : > Hey, > > > Problem with checking array on assignment is that it could be N > dimensions > > deep and one would have perform check for each item in each dimension f= or > > mutable values which could have some performance implications. > > if you want to enforce that in userland now, you have even higher > performance implications. I wouldn't worry about the performance of > edge cases and take away a feature for everybody else because of that. > > If there's a better internal implementation, it can always be improved > later. > > > Regarding constructor call, upon first initialization of object, you ar= e > > allowed to assign values to properties, after constructor is executed, > > object is locked. If you try to call again constructor on the same > object it > > would fail as soon as execution reaches first assignment statement > because > > object was already marked as locked. > > Sounds good! So it's already implemented basically. > > > I agree that it would be better to pass by value but I am not sure how > would > > that impact the way we currently manage objects in object store. > > If we both agree it would be the better way, why not draft an RFC for > it and find someone who knows how to implement it? > > Regards, Niklas > --=20 Silvio Mariji=C4=87 Software Engineer SMSGlobal --001a1135d3f21819d00565e5d576--