Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:113352 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 53725 invoked from network); 3 Mar 2021 16:01:49 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 3 Mar 2021 16:01:49 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id B0FF018054F for ; Wed, 3 Mar 2021 07:52:18 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-io1-f43.google.com (mail-io1-f43.google.com [209.85.166.43]) (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 ; Wed, 3 Mar 2021 07:52:17 -0800 (PST) Received: by mail-io1-f43.google.com with SMTP id i8so26216335iog.7 for ; Wed, 03 Mar 2021 07:52:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=benramsey.com; s=google; h=from:mime-version:subject:date:references:to:in-reply-to:message-id; bh=r6cNQfUwSUSJmSjx3ETWmP3aXN+JtB57QoBhIe6nDqo=; b=DD9qE+jUbzZP/yJsFYhS6sWmRGEOBKGOkYUsNfFoOhkw2ZhXz+2+ZhoIRRpGZOPXDC a6YV9c2NQOGWrMWdV/MWkATczEil0iotfdUWSdijJ9zIxdSR0K3puJWjJtHBzzhdTSUT 99oHp05Ylje8rDRrho5qo/SXFOc7HZgOoRcLaKdMQ8tZaIbr2YJ6CVRKE7zPz67Vl8wp cSX6mY3BJmq2GtW3GQnqnMeO/xN5+QzE9ByVGPC40Bh1M6U/9KiDawEzG56VINk5L42E waMRrHdIkZN2OIyHyqIFkpDIsZk8UPAz30nBAoHMDfYweSghj7BiN8uTTiM+ODNLRb2g nAmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:mime-version:subject:date:references:to :in-reply-to:message-id; bh=r6cNQfUwSUSJmSjx3ETWmP3aXN+JtB57QoBhIe6nDqo=; b=c/d8c+Z2zjQGfAwnFcUGei24Q3m26ppJQGXEbV06/vev2Panu4uVtBYOmk8Tr+OOE1 1lkpFdndsyDncCeDaLVsgkqv2EtvYhU74Jk+FA6fpzx4vFx/EXnQtbe90rW/Vfj4Vytl maAnQHSEsdqKOiiWBGaBchKo0Fbvw96Z3vmFUcLjzAwRvGqTssAHPc7gwtg6Iui78Vyw 2ASCtjkssaQCjdMt3+4mASCWTpLSYlqStPYiLEs+9lCP1d1n02+u7gYj9zXR1HcxAhTz /SIt9GYmcz0PdqlcoLg3zsMtEBew3U7zYNBUUlEYDf6qAtx2yZKIcYIb2e1FXmf7f0JG 7slw== X-Gm-Message-State: AOAM533dIGtvY0NPSjAnXwAGUDdIJZwiIeELZDNWVwMaLyTc2O2jvFer h6mD8LrrrolntKFsoFX//6uS9tdZe5uZ6A== X-Google-Smtp-Source: ABdhPJyNJLfgYo3KPRLZzz1W12exKQ5h3A6JfLjvnieMmx+8EoiBa+42RVkd95YPXHEIg7nGiCcR3g== X-Received: by 2002:a02:93e9:: with SMTP id z96mr27392245jah.73.1614786734049; Wed, 03 Mar 2021 07:52:14 -0800 (PST) Received: from [10.20.42.124] ([96.61.105.82]) by smtp.gmail.com with ESMTPSA id d2sm5172096ilm.7.2021.03.03.07.52.13 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 03 Mar 2021 07:52:13 -0800 (PST) Content-Type: multipart/signed; boundary="Apple-Mail=_FCC49D64-3865-4F68-8B37-C59A245908A1"; protocol="application/pgp-signature"; micalg=pgp-sha256 Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.4\)) Date: Wed, 3 Mar 2021 09:52:12 -0600 References: To: PHP internals In-Reply-To: Message-ID: <3992DBA7-4BD8-4522-8223-AF7045987D75@benramsey.com> X-Mailer: Apple Mail (2.3608.120.23.2.4) Subject: Re: [PHP-DEV] [RFC] New in initializers From: ben@benramsey.com (Ben Ramsey) --Apple-Mail=_FCC49D64-3865-4F68-8B37-C59A245908A1 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii > On Mar 3, 2021, at 09:03, Nikita Popov wrote: > > Hi internals, > > I would like to propose allowing the use of "new" inside various > initializer expressions: https://wiki.php.net/rfc/new_in_initializers > > In particular, this allows specifying object default values for properties > and parameters, and allows the use of objects as attribute arguments. > > The RFC is narrow in scope in that it only adds support for "new". An > extension to other call kinds should be straightforward though. I like this proposal! Are nested new expressions allowed? function test($foo = new A(new B(new C))) {} Cheers, Ben --Apple-Mail=_FCC49D64-3865-4F68-8B37-C59A245908A1 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- iHUEAREIAB0WIQToXQMR3fpbrPOmEOewLZeYnIwHGwUCYD+wrAAKCRCwLZeYnIwH G6ziAPwL0+Ibh2ePHL5fRdgcCt0Nw+dHLf7bIeH+q09pUopHMgD/UBr0AS9fwFEU kCSnv+xd6bCNHcIIN00kiyr1AnF7WP0= =zK2+ -----END PGP SIGNATURE----- --Apple-Mail=_FCC49D64-3865-4F68-8B37-C59A245908A1--