Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:112285 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 29865 invoked from network); 25 Nov 2020 09:35:10 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 25 Nov 2020 09:35:10 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 608091804B3 for ; Wed, 25 Nov 2020 01:01:03 -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=-0.7 required=5.0 tests=BAYES_05,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.48]) (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, 25 Nov 2020 01:01:02 -0800 (PST) Received: by mail-wm1-f48.google.com with SMTP id a65so1393795wme.1 for ; Wed, 25 Nov 2020 01:01:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding:content-language; bh=tRtDKc5lsGEjrGOG1n2MutijEYH7KTvJOCZDJKaEU0Y=; b=Xr4+G/Lv0twshkTI8+d7xgrn9f8PDCRFh1MpZn0MNjUsuxr0reoKSeWxpq3mDkLU0Y iddgo17lvbg8MttPzzCy5np9ME/yoEpZKJIGfzwyTn/WjcM7IPDbf22MsLnsvS6BPXfv Q+nYJZHeR3/WLq5iX+hUY7HtWoz+zhjt1P/tENL+P57A5bReeJZG1SXPA+PkQissM8bl dFuaypjvgIkmBirwlfvBWWFhcO6wASKvHp8GLJKU+XAGGVBC5j9OqYxGNQ3EC6HnaXqr K4zuhktedxSSIFnGGGH0a+KZCF68chjhrHkV8Rg6wtZccSVhs8gzphRuHMWCFCsCHhEh AL8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=tRtDKc5lsGEjrGOG1n2MutijEYH7KTvJOCZDJKaEU0Y=; b=GiWX49LtLJfaNrRCeTBHWZGgQVEgzp3wBV/T7L7ieLLovbEZHrl3TozMa5sbJqP+nL VEjD1kPnZ2a+jIcj/NYUgOWulryqz1h6Vxa7aQxwKmoHBF4qgPFUOzhPff8hMJ/3lmvy qekIYM8EPiqRgUM3azTbjd86B/vrRGp9SrZ/W1lAWcwaDgrndj89KbgAWN26rlxIle/X y17iWEigBjcNihIO86HZ1GSUXbeb0p4ye1vSKZ7QieL0YQDxZjyOVzHfSdyFV+9wQYyV dkqps7sT3DO0jGgrf75svnMyPUx4j6cmbUihx3eoYvQRBa45Az2+XPtXU5XFXKB14KIe 3u2A== X-Gm-Message-State: AOAM530XNj5D2csvOeeNVRqoOlx/r1Eymf3S+CCWciPBHVsExwdye4XZ Az13RO6ie/KWrP/atNtP6BaJCR7nwUw= X-Google-Smtp-Source: ABdhPJzCQpvD+MbR7IZ1VJexYUqYdfb2h4pr7uG3KfJQRAONykHmb35TyuzSwV95VY14L021Z9ddeg== X-Received: by 2002:a1c:2b03:: with SMTP id r3mr2650608wmr.184.1606294859735; Wed, 25 Nov 2020 01:00:59 -0800 (PST) Received: from [192.168.0.22] (cpc104104-brig22-2-0-cust548.3-3.cable.virginm.net. [82.10.58.37]) by smtp.googlemail.com with ESMTPSA id e3sm3552689wro.90.2020.11.25.01.00.58 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 25 Nov 2020 01:00:58 -0800 (PST) To: php internals References: <258d9a8e-e73e-7b8a-5d9f-64a449def1da@gmail.com> Message-ID: Date: Wed, 25 Nov 2020 09:00:58 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-GB Subject: Re: [PHP-DEV] List of attributes From: rowan.collins@gmail.com (Rowan Tommins) On 24/11/2020 23:09, Theodore Brown wrote: > That's not necessarily the case for nested attributes. A developer > may want to declare that an attribute constructor takes a single > attribute with a particular type as one of its arguments. I'm still not sure what the use case for such an attribute constructor would be. Your example with "CustomError" seemed to be abusing nested attributes as a way to get a value object into a static declaration; and all the examples I've seen of nested attributes/annotations "in the wild" are wrapping a list of attributes in some kind of container. > Moreover, re-purposing the syntax for function > calls or class instantiation is likely to cause confusion, since it > looks like the code is doing something other than what it actually > does (and of course it would prevent ever extending constant > expressions to support function calls or class instantiation). Then maybe we should make it *be* instantiation. The example you gave earlier, of CustomError, would be just as useful outside attributes, e.g. in a property initialiser, so perhaps what we need for that use case is not nested attributes at all, but the ability to create some subset of objects ("structs"?) inside static contexts. That can be entirely parallel to a feature that lets you wrap a list of attributes inside another attribute, and does some recursive magic with reflection to let you delay calling their constructors. Regards, -- Rowan Tommins (né Collins) [IMSoP]