Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:97358 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 49933 invoked from network); 11 Dec 2016 23:30:14 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Dec 2016 23:30:14 -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.223.179 as permitted sender) X-PHP-List-Original-Sender: marijic.silvio@gmail.com X-Host-Fingerprint: 209.85.223.179 mail-io0-f179.google.com Received: from [209.85.223.179] ([209.85.223.179:33544] helo=mail-io0-f179.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E4/62-27518-181ED485 for ; Sun, 11 Dec 2016 18:30:11 -0500 Received: by mail-io0-f179.google.com with SMTP id d9so143968149ioe.0 for ; Sun, 11 Dec 2016 15:30:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=XhQhuET7CgTn4PhcwiZmBgZGjoHJ181p44K3oAeghUc=; b=dLfXIWZUBgqodYtitYRd0kiYupF2xpsLIXnJXVn8eL5CVv4QugFGbAZEezs+jv4PJ+ QDM7Jr946lGinCxtU0KWlkIORpqyr2zkcMGIMPv44mrjtbNAAI3fFvCia26st9n8/NKi QtplBjx5jHITe9Gdn3m7fw6NEqdYm52ZFUY0FqOZG/fHY30yUOAe4BVMpJCqRXhhko6H W8wNWujKtLR+Qp5YYOHO3RNQV/JIgZRwoCjx+TwYWkP5HS/8kzRcek8V5w37xeixc+sp 7Nkj8E/y+xil27nkXn2iK7/lTiKxDiFPGmTXIXxOR48w0Bz6I5wM9+tLypyvqH9gEqOz 8ItA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=XhQhuET7CgTn4PhcwiZmBgZGjoHJ181p44K3oAeghUc=; b=ghw1wAY+q9MTBqq+f4VHlPZ2nV98n6ub1kUOwPxSaE2n8ImQyT1/JvJQKHcWBhVPSC XmBRTpOU6smw7S4wYUt870FmW8nfi2WJF+mwrISZLelF+ZAVNqkH6+ddDITU4ik0LUJJ qei+sveXPDv85covcvPk5txfPMlojm87lpUGFh18HZLOClloS0rc7B7UkP7jbYLh+QeD dc1cWHy1rjQtfr1DiUncVR1Ue3aPmFs6nemLGZDmT1Ws4/gzVQlOF7DgQwgLAcpfkcpJ 8pKJH/JiBNzqiKgrSwmsOOfjw56+fbv/+NrtdhHF8XmltqVFq23df1/23zWpL0yxmUdn jN5A== X-Gm-Message-State: AKaTC025EPjKIWMA+U5FvGyghvKoVfGvAj0KWYRqmHy93NRtVGHlpviPXxAAGMo/IwOL8j9vEW1lAPmbfcoZIg== X-Received: by 10.36.135.130 with SMTP id f124mr15706677ite.57.1481499005488; Sun, 11 Dec 2016 15:30:05 -0800 (PST) MIME-Version: 1.0 Received: by 10.36.110.142 with HTTP; Sun, 11 Dec 2016 15:30:05 -0800 (PST) In-Reply-To: References: Date: Mon, 12 Dec 2016 00:30:05 +0100 Message-ID: To: Marcio Almada Cc: PHP internals Content-Type: multipart/alternative; boundary=94eb2c030928f518c405436a5d55 Subject: Re: [PHP-DEV][RFC][DISCUSSION] - Immutable classes and properties From: marijic.silvio@gmail.com (=?UTF-8?Q?Silvio_Mariji=C4=87?=) --94eb2c030928f518c405436a5d55 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable @Larry, first of all thanks for pointing out grammar issues, I will correct them. Now, regarding cloning of the immutable object, I'm aware of that issue and I'm not sure if we could even use clone operation for this purpose, I do have one proposal for that matter, consider example: immutable class User { public $firstname; public $lastname; public $email; public function __construct($firstname, $lastname, $email){ // } } $user =3D new User('Foo', 'Bar', 'foo@bar.com'); $new =3D copy($user, ['firstname' =3D> 'John', 'email' =3D> 'john@bar.com']= ) Copy function would take as a first argument an immutable object and as a second argument associative array where keys represent property names and values specified will be assigned to those properties on a new object. @Marcio I will submit PR, have you found bug or? Cheers 2016-12-11 23:35 GMT+01:00 Marcio Almada : > > 2016-12-11 12:57 GMT-04:00 Silvio Mariji=C4=87 = : > >> Hi, >> >> Discussion is open for following rfc https://wiki.php.net/rfc/immut >> ability >> >> Cheers >> > > > Hi, > > Can you make a pull request? I'd like to comment the patch but it's not > possible to make inline reviews only with a diff uri on github. > > --=20 Silvio Mariji=C4=87 Software Engineer 2e Systems --94eb2c030928f518c405436a5d55--