Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:109085 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 82160 invoked from network); 17 Mar 2020 03:00:20 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 17 Mar 2020 03:00:20 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 2ECD41804E2 for ; Mon, 16 Mar 2020 18:22:53 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-lf1-f47.google.com (mail-lf1-f47.google.com [209.85.167.47]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Mon, 16 Mar 2020 18:22:52 -0700 (PDT) Received: by mail-lf1-f47.google.com with SMTP id c20so15786271lfb.0 for ; Mon, 16 Mar 2020 18:22:52 -0700 (PDT) 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=MKDG3pkl40jjQ5cHjdWnten7LgmyKVCi4rlnV7hp5+0=; b=nHrDCYj5gXYOuNygVWUHTDduefyc+X6CcLeQLPQNJkMkpuPVAL9CsClinowbPJNXOK hQPjtPr2C7luilLG8jHTGXPkvBm0sFAKXPh//kZAirid8zdbk1Lh/QLFF3++bs3ekqE0 lby3b8Vlt7q3nfuS8V9L3Hqgrh9F6zcIIVOlzmvhoRREKHQKzHwYGIKHSBQ0SeHIm1L0 e7B06MtGieIg/afDp5zMxIuC+c4fSPLqX1PGl148iUL0CKfNAtS49T5+3Vayhgw8Mu6K RqO5zAl0+B7cYyXHPpf5M98bmU4K1usVCHqNVcqXUahkM7f16Hz0Az18Z42rCoDsWyAu 4cZw== X-Gm-Message-State: ANhLgQ0kwTSW0fdiZMRB9ZU5ONHTjbHWXT8KrklZSraS4VzuzhOwpglT aFFUqxg37/UUamBpmh6lE4X/9q90pkSkqCuIErmC0fTl X-Google-Smtp-Source: ADFU+vt9R+SOQJliR6mZ3F9pkRbqk+Bkxg7ahKUtND7hbAkXhDmEqE2rYTGK8I4pUiTop60Se7ic6SCwGdN9hd0JWFI= X-Received: by 2002:ac2:54af:: with SMTP id w15mr1259342lfk.17.1584408171008; Mon, 16 Mar 2020 18:22:51 -0700 (PDT) MIME-Version: 1.0 References: <1C074893-F260-462C-8D73-5DF764A56DE0@cschneid.com> In-Reply-To: <1C074893-F260-462C-8D73-5DF764A56DE0@cschneid.com> Date: Mon, 16 Mar 2020 20:22:40 -0500 Message-ID: To: Christian Schneider Cc: php internals Content-Type: text/plain; charset="UTF-8" Subject: Re: [PHP-DEV] [RFC] [DISCUSSION] Compact Object Property Assignment From: jakob@givoni.dk (Jakob Givoni) On Mon, Mar 16, 2020 at 9:26 AM Christian Schneider wrote: > [] suggests an array but then is uses literals and = instead of 'strings'/$vars and => which looks wrong to my PHP eye. That's ok, square brackets are usually related to arrays and what I want is something similar to array literals. The rest of the syntax is exactly the same as when you assign properties on a object currently. > you want to initialise so many properties manually instead of through some sort of constructor. Yes, exactly. From the RFC: "The purpose of this feature is to lighten the effort of populating data structures, especially medium to large ones." And as I say, since we don't have named parameters, this is a pragmatic alternative.