Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:107189 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 96891 invoked from network); 17 Sep 2019 13:31:02 -0000 Received: from unknown (HELO php-smtp3.php.net) (208.43.231.12) by pb1.pair.com with SMTP; 17 Sep 2019 13:31:02 -0000 Received: from php-smtp3.php.net (localhost [127.0.0.1]) by php-smtp3.php.net (Postfix) with ESMTP id 1AC462C144A for ; Tue, 17 Sep 2019 04:08:10 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp3.php.net X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=BAYES_00,BODY_8BITS, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: X-Spam-Virus: No Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [IPv6:2a00:1450:4864:20::334]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by php-smtp3.php.net (Postfix) with ESMTPS for ; Tue, 17 Sep 2019 04:08:09 -0700 (PDT) Received: by mail-wm1-x334.google.com with SMTP id 5so2881637wmg.0 for ; Tue, 17 Sep 2019 04:08:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=4gOl6Bxz23Sg9aLHZMYDd50I7Pk+tGA8GJoimK8Th/U=; b=JQrs1o5KfWcMJGktWhyJfrSFWi9Zw0Jp64E7asDH2qUyuMicjZ58rpZj1Evu7U8x3m OrCESqNy5jWzOS8M9YX6bF8ijgYOqiOZrLuAajQ6xdCp8454EH4ERVPYrOStl8JcGyZD R+OGJD7Szi7q6hKjCy/xClWihyWZ/iCzXHeKEAvY2pZTNqdyez36TAAY1VplzYg4BECa px9aBF019QU8oDu4yy/K9mE+aq/U1BiT9vTte4HZkv8d3IMKK2k1KBct69NvHMLZlBcC syWrZagu26RsTe0EfZyeL8FoOTc1JtNEFhnm98381WyaYMC5HjC9eqcLYPp8LGQk452/ e3Uw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=4gOl6Bxz23Sg9aLHZMYDd50I7Pk+tGA8GJoimK8Th/U=; b=mQhp5ZwaJ7B1TIjzMVeJ7TdEX659+C3tpSaaXfwa1lCqU+FJj3KGsHO0bDTVEGp6I8 5NFruQQHh20WBG/cBeRLOTf+7Eb2BVhNIqiXeTWtProFa/IcY0mkOlJkthZlpn3Tt/mp FXMu1NJWKCnVbsDyjvO6wHQSgRgujuvESjtPomQpsyFfsmvoETmHYtbY1kbW3RPKA45W v+rPp9CMRI/vxMIhAkUuwtK5HGrdRrOByDTP54A6NQBsFBioZi+bNNILYDAJEE0/bhiz 5DucikaS+gyvp0iceJrWWqK7KaZ87BAG8yF1jucx5pptYhrnWLDYvyzIEyxuGCRzihpP etrw== X-Gm-Message-State: APjAAAULM25i/9of6K1rEKUU2/n5DpmSAmLkXvm4YyfcpkDko4mQWCP0 +nSHjSgB+2FIZNJP+3p+jFuiGUfzuD3V/NUcmYk= X-Google-Smtp-Source: APXvYqy64iX8JI5+b4k/U8lTqrj0GXfF4+PHVHGy3/by1y3iM2GiG5jl3qQHspGi26HQvdyyg4z/UG1T6xp5hE+XLDE= X-Received: by 2002:a7b:cc0e:: with SMTP id f14mr3015149wmh.42.1568718488590; Tue, 17 Sep 2019 04:08:08 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Tue, 17 Sep 2019 13:07:42 +0200 Message-ID: To: =?UTF-8?Q?Micha=C5=82_Brzuchalski?= Cc: PHP Internals List Content-Type: multipart/alternative; boundary="00000000000043ddde0592bdbc5b" X-Envelope-From: Subject: Re: [PHP-DEV] [RFC] Object Initializer From: arvids.godjuks@gmail.com (Arvids Godjuks) --00000000000043ddde0592bdbc5b Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable =D1=87=D1=82, 12 =D1=81=D0=B5=D0=BD=D1=82. 2019 =D0=B3. =D0=B2 16:00, Micha= =C5=82 Brzuchalski < michal.brzuchalski@gmail.com>: > Hi internals, > > I'd like to open discussion about RFC: Object Initializer. > > This proposal reduces boilerplate of object instantiation and properties > initialization in case of classes without required constructor arguments = as > a single expression with initializer block. > > https://wiki.php.net/rfc/object-initializer > > I appreciate any feedback you all can provide. > > Thanks, > -- > Micha=C5=82 Brzuchalski > brzuchal@php.net > Thank you Micha=C5=82 for the RFC, I've have been keeping up with the thread and at this point, I do somewhat agree with people that maybe the RFC should go into V2 version development. It really seems like the scope of the RFC is just too small for the feature and it might be a good idea to expand it a bit. Also, I have this question - is there any performance to be gained here? Cause right now object hydration is an issue and is somewhat slow. Can it be optimised? Also, usually I don't really want properties to be public (aka writeable), so that means `private/protected` and I need to use the methods to set the properties or reflection. I might have missed or don't remember it, but I don't think I saw a discussion about that use-case. Value object, DTO's - all have a big use case for it. --=20 Arv=C4=ABds Godjuks +371 26 851 664 arvids.godjuks@gmail.com Skype: psihius Telegram: @psihius https://t.me/psihius --00000000000043ddde0592bdbc5b--