Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:115317 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 46248 invoked from network); 6 Jul 2021 10:36:29 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 6 Jul 2021 10:36:29 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 6F5F41804D0 for ; Tue, 6 Jul 2021 03:58:13 -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,NICE_REPLY_A, 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-wr1-f46.google.com (mail-wr1-f46.google.com [209.85.221.46]) (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, 6 Jul 2021 03:58:12 -0700 (PDT) Received: by mail-wr1-f46.google.com with SMTP id a8so13873968wrp.5 for ; Tue, 06 Jul 2021 03:58:12 -0700 (PDT) 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=Hoj3Ekbhh36isLbYUQSABh+F5tyZ+soENwrmGFlDo10=; b=phTPchw8ZwaCZwHksd2j4qma4qZlPzAC0l0CAqaOoNve2PO186FC3eIg03CDkwpWeO EIZJ0RUjphhTKXcpOXuqK6lkdYUAcUwGnONWusB6esDXsDB98Udrwt6IcaYw4GMqJ34V CrUq47cKDcfkfP8QUzL+pn6UIc4+1BtYzGhXLyTjcFyUxdIywiAzbXCGPlg3cQpSSSzV QAVXjrtNOL1R3ZWvFKlWd+dByTNpJ78V6WinlOkmWxMNqc9CmRO1CL6YPAyAhFbWj4QR 2Wjdfh9NI7z5zLdxpyDaBMlnkTz4wi4OnkcbqVAxrBU7q6Th5NZQICcpFpl76XcM/pVD UIaw== 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=Hoj3Ekbhh36isLbYUQSABh+F5tyZ+soENwrmGFlDo10=; b=s64x4mTfz7hPtCl66bsSCMbH6qsalk/slMk8OhIDFeWO9n180+m4b/JEchePhP7bqp aJjN+ZKxxdjnTm6W54IqEhL5ysuIJvAAh0lj7kvfvEIYpePEJF19d03ss/WyAc3aKU1O hrpE1jpMOlgZQr3JHoj9WYburkPLs1nqbXvAu8xPcL7WI5Jmw6/1n/QhG2vopMXnEpFi 2G8PYzkEUkQd5eUNcKNkmoazC5dagn8JXHi1yXt2t/oC8hOQcpkPQ07Kef8Xr3h1yGds +mns8Z3CkPTC2it4yzbldHtvi3raKiuGB3n7aUV8/YnSFG/ZHm9pKBLPU243QBgFmCrh IIdQ== X-Gm-Message-State: AOAM530Tp3W77JxmFVRYGQBP5V/L7MD5iDrEHbfxeDWT4arcT9Wrh10h HJj2b25s8marhYb2ft5CqM936S3Rco0= X-Google-Smtp-Source: ABdhPJzlcch3eRSNLrXUcs3i9iEQtr7ltaAthmiru+/wNNtlOQC5hc3+htvoSkJyN965RWi253CzTw== X-Received: by 2002:a5d:5143:: with SMTP id u3mr21499803wrt.51.1625569090687; Tue, 06 Jul 2021 03:58:10 -0700 (PDT) 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 g3sm1658545wrv.64.2021.07.06.03.58.10 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 06 Jul 2021 03:58:10 -0700 (PDT) To: internals@lists.php.net References: Message-ID: <34e76830-043f-3bae-4d60-9871010da0ed@gmail.com> Date: Tue, 6 Jul 2021 11:58:08 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-GB Subject: Re: [PHP-DEV] [Vote] New in initializers From: rowan.collins@gmail.com (Rowan Tommins) On 06/07/2021 11:31, Benjamin Eberlei wrote: > This is not 100% correct, you can have an attribte #[Foo(Foo::class)] and > then calling ReflectionAttribute::getArguments would also require to > resolve the type Foo. So this is not different than what could happen right > now already. Despite its name, "::class" doesn't care about class definitions, it just performs a string substitution based on the "namespace" and "use" statements in the current file. In most cases, that happens entirely at compile time, so the following two source files compile identically: Short form: namespace Somebody\Something; #[ Foo( Foo::class ) ] class Whatever {} Expanded form: namespace Somebody\Something; #[ \Somebody\Something\Foo( '\Somebody\Something\Foo' ) ] class Whatever {} There is no need for the class \Somebody\Something\Foo to actually exist in either case, the argument is just a string: https://3v4l.org/bgNa2#v8.0.8 Regards, -- Rowan Tommins [IMSoP]