Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:109631 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 13098 invoked from network); 14 Apr 2020 15:33:38 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 14 Apr 2020 15:33:38 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 552931804F3 for ; Tue, 14 Apr 2020 07:03:20 -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.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE 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-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 ; Tue, 14 Apr 2020 07:03:19 -0700 (PDT) Received: by mail-wm1-f48.google.com with SMTP id d77so13079427wmd.3 for ; Tue, 14 Apr 2020 07:03:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=beberlei-de.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=marC0iVLDoj/I4BmNzlw89UeXffugBRP0xMHQAZsPPI=; b=XuxeX4JMjunOCtog0ugF7Arq5xW3pdvBwXVzc7FbLDXbIH4lu+OiDDHY4S2v/LTEcw 9fCveHtquiA13THBf4MDC+jQNDdDeDGzV3oRQRK01i1E8YVQ1ZJX9rd7gf5A+0gxcyY1 q8RkfA0PFRKVIw6cLqFdHChA450Oo4HFQ570wTjYagcdlqjb+DFGx7/3T4toy1K93R0M +EvY5Yp7A6fA1qjYnmMFdsyUKmEcFmd9peFfWDaacjJnJFPgKh91svkiNWxBSCg5jsVQ JSXl5gH3H+V61WahrtnHARJbEEwE8E8l5A8vX/gDF0vi5wcGHJ2ZOHl8WKik+xie2RNm wkaA== 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=marC0iVLDoj/I4BmNzlw89UeXffugBRP0xMHQAZsPPI=; b=pxGMv06CxLt+cLGq3+Gs0d2sh07PLW5hA6DIBQpzMXGakGOaFqLNDCl6naX2e2HSOj OAjoTSjO02Ql8hVNg9iUrwuH2VFHETabLqb1NP2ASjaHms2DQrhqEepqFqlAUfxEKBiC jSPWJmjouQOwJtqRdBW0A3zqC/EAGquR3lH7rbQE5umFd6y4yxoXlnhv5u8HSfHg1qGH DZMbfjNUgoTm7mFdYu/hr7C+khCKgFM46b95IJNK/LLgGJFpaX90pS4nQRfNJrEwYmaT pRdxHQhl6c4p4Bl/mV+SOyNmn58rp8Rj78lm6zjwMFI5EdJcR77tV34oNYhb1uuBS0i9 XEqQ== X-Gm-Message-State: AGi0PubK5ztaUIXW0o/aYCZUuNO+rPFUvmtN4tHhm7TnbcuVH0e/FTxA YjMdirT1U4P+l1fuC5ocjEHUDYcYRRTkHG8YlZCCeQ== X-Google-Smtp-Source: APiQypL39VRznEhkYO77NfV+sxDLbke3Mcp2EB66ubWoUb34Do7FTCTpHFL6sBwfKnWWEV19vGHfdWe6T2DmGufgg/c= X-Received: by 2002:a1c:bb08:: with SMTP id l8mr46622wmf.168.1586872998725; Tue, 14 Apr 2020 07:03:18 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Tue, 14 Apr 2020 16:03:07 +0200 Message-ID: To: Nicolas Grekas Cc: PHP Internals , =?UTF-8?Q?Martin_Schr=C3=B6der?= Content-Type: multipart/alternative; boundary="000000000000649ed805a340a98f" Subject: Re: [PHP-DEV] Re: [RFC] Attributes v2 From: kontakt@beberlei.de (Benjamin Eberlei) --000000000000649ed805a340a98f Content-Type: text/plain; charset="UTF-8" On Tue, Apr 14, 2020 at 3:04 PM Nicolas Grekas wrote: > Hi Benjamin, > > I have updated the RFC with much of the feedback received here, on Twitter >> and Reddit. >> >> https://wiki.php.net/rfc/attributes_v2 > > > Thanks for the update and for giving this a try! > > I'm wondering about nested annotations: as you know, they're quite common > in apps that use doctrine/annotation. > How do you think these should be migrated to the new system? > Nested attributes are not supported in this step, because they might interfere with potential changes to constant AST. Tyson dipped into that topic a few weeks ago. If constants were to allow something like const $foo = new Foo(); - then this would automatically be available for attributes (they use the same concept). For now I suppose the approach would be to flatten the attributes, for example: @JoinTable(name="users_posts", joinColumns={@JoinColumn(name="id", referencedColumnName="user_id"}, inverseJoinColumns={@JoinColumn(name="id", "referencedColumnName="post_id"}) becomes: <> <> <> As you can see with this example, named arguments is another under construction area in the language that would automatically spill its benefits to attributes. Think of this like scalar types in 7.0 that missed nullable, which was added in 7.1. > Nicolas > --000000000000649ed805a340a98f--