Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:109714 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 53572 invoked from network); 20 Apr 2020 12:09:06 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 20 Apr 2020 12:09:06 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id F27651801FD for ; Mon, 20 Apr 2020 03:40:15 -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=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE, 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-io1-f47.google.com (mail-io1-f47.google.com [209.85.166.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, 20 Apr 2020 03:40:15 -0700 (PDT) Received: by mail-io1-f47.google.com with SMTP id f19so10370530iog.5 for ; Mon, 20 Apr 2020 03:40:15 -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; bh=WcIN091Y6G0zcslpzNECGf6liD5W74BNES95VA1FyMo=; b=Z+rGYQ4HnplItxmzTfE6zduY7jlr/wX/hyk5oWFM+pUprvpQPsS9akM3hOpcu7J7sA 12wcG0wsb5MVJJUzc0SBpLp+0o53FJxiX5O2ro623QjgbJpVNxnt2bLYXv7iQy84Luyf 3/Bzwr1tS6RB0us+SdbyJhy/Xhw9boMDeWDB1zxKvlrUqQ4T6kS76CWnWp/Kw0yJ2o/K QgV4Vc3nUsYf/70zJxeE2ApkgGFI2SPy0D+Ewwyw8J3PT2DTeIshtoRbDd3IiUDoWLLd SRvCjy6IlC0yshiYWOqC2EO9WsWBTWgrvs38Gjhj/Y52Zl6VL+k+6JgN43HS3vWWq5kI faOg== 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; bh=WcIN091Y6G0zcslpzNECGf6liD5W74BNES95VA1FyMo=; b=YMcMy3Grp/qtfFTsLFcx0Amz1vnJlNfi2wZ/Te+5IhxyTBgE/b4/IJI0TWFtpil+/C +jCYOB1eX9K1bZp1ALNAWjwANOoR/ODHDhknXO0bOXfuG/mYTQAwEksiUyoqcyA2q9LE hMMfyLiyO5HsUcJBC6vGwHCfNzm1S6Htkp6f+W1qamWhu46HiXtc3kWorv/Hd7Hf2j3l WwQ6fkKR3HUIl2lDDoOtzT7JM0oP6oMVh4kjCoUz4l0qE2E8J5ujcKZ9XKbUo7B75bab SBHQU2A+H3+O2KeaBBWMUdSedoYL5Mri40iC0/x6FquBKLuu3GjhQ/HdndCKMdNUY1NU 8Viw== X-Gm-Message-State: AGi0PuZJTopHN6N46efgAS7rTBWaiZFtVxE639jdWQ3lAnEqBMsqXmD2 Fyk8R5oowOFJ2MRRjGvpXSqD9v4N1Q4MNGAoGfOADCf1 X-Google-Smtp-Source: APiQypIohaPPoJEDzqjD3PaBKH5jpPWj6IxNyrlCPUMvv1RtHwvdkcw7cbApMIwchWXyivBLaNh1C+16bXuisHMozmQ= X-Received: by 2002:a6b:b258:: with SMTP id b85mr4353333iof.141.1587379214660; Mon, 20 Apr 2020 03:40:14 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Mon, 20 Apr 2020 11:40:01 +0100 Message-ID: To: PHP Internals Content-Type: multipart/alternative; boundary="00000000000036bbc705a3b686ca" Subject: Re: [PHP-DEV] Re: [RFC] Attributes v2 From: rowan.collins@gmail.com (Rowan Tommins) --00000000000036bbc705a3b686ca Content-Type: text/plain; charset="UTF-8" Hi Niklas, On Mon, 20 Apr 2020 at 07:48, Niklas Keller wrote: > > What's more important here IMO is the restriction of inheritance, > mainly because the raw arguments are exposed via reflection and won't > be compatible between parent and child attribute in any case. > Could you explain a bit more about the problem you see here? My understanding is that the reflection API is designed to allow two usage styles: * Treating attributes as untyped mappings from a name to a list of arguments (fetch all, or filter by exact name, then call getName() and getArguments()) * Treating attributes as classes instantiated with the argument given (filter by INSTANCE_OF, then call newInstance(), formerly called getAsObject()) For the first style, inheritance doesn't matter, because the attribute name is never resolved as a class anyway, it's just an identifier (it might happen to look like one, to avoid naming collisions, in the same way XML namespaces look like URLs). For the second style, it's up to the user to provide the right arguments for the attribute they used, just as it would be if they instantiated it directly with the "new" keyword. The only case I can see where incompatible constructors would be a problem would be if someone filtered by INSTANCE_OF, and then called getArguments() and expected them to be consistent rather than using newInstance(), but I'm not sure why anyone would want to do that, so a one line note in the manual pointing out it's a bad idea would seem sufficient. But perhaps I'm missing something more fundamental that makes you feel that inheritance should be restricted? Regards, -- Rowan Tommins [IMSoP] --00000000000036bbc705a3b686ca--