Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:120799 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 27992 invoked from network); 12 Jul 2023 22:05:41 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 12 Jul 2023 22:05:41 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id E99571804D4 for ; Wed, 12 Jul 2023 15:05:40 -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=-0.2 required=5.0 tests=BAYES_20,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, T_SCC_BODY_TEXT_LINE 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-lj1-f175.google.com (mail-lj1-f175.google.com [209.85.208.175]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature ECDSA (P-256) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Wed, 12 Jul 2023 15:05:40 -0700 (PDT) Received: by mail-lj1-f175.google.com with SMTP id 38308e7fff4ca-2b703cbfaf5so122691051fa.1 for ; Wed, 12 Jul 2023 15:05:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1689199538; x=1691791538; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=RxKF3uiDqlLtYwCide8A5yd60mkyn5jHQq3l+9ytNOM=; b=VyDaB3ow+IJQL1cIvQLwzfeD9QjTopIFP3uMepF88sE7wfiaz8FADA5Yb3iasJcw02 zA6pcuwspLW0GxySepxXjpn38FSDII1QOGusOupwocUVv32otGV9LAosC73TAkmwmraS xPkjYGjp6laS2zBMjSS//4gnnPwEqkz1v0rX1IEghdg04bxT7DikwvLg5gGYdU7DWNML Wgibpa95CnI343A0bpPpbvhy52r9DwbuMlas7Yyd9oF4z5COH8QjV3x3J3Nh96djIauP B97ZhzpT7/XDVQc521/pJXkHewUPOucAErd0Irk5L0lF/ag2pGzrrb1+ZKerifn10uRJ qQ1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689199538; x=1691791538; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=RxKF3uiDqlLtYwCide8A5yd60mkyn5jHQq3l+9ytNOM=; b=T9jnV+nD4OlZjtsYSGUx+uByguysKGIjYsycqGktQE6EQ7Wv3ZeZJ93CfVRMoQ2MJq ZDxc6+KCwQq1RCJFYN2TGw+QiMXI+ekt5aJVUBkAlFRWJggA8Jby6FYy8uecC8lFx85G Y79aMKyOitsh8smd8jrvf0RYuLMbf+PyoQqrWdNV/y3dnwFVCEFwnBnB8mrApf0iZZhd jSL2HzhZk+KaW5niuL/rSH08YL2+IRtum7KhZgyujxbEWxK9zwRx+8+/vr8Lq60kG1Iu txajxte01wKgegUGdczvkmb8/mbg2IFM7cvC4ZoMqCQjzMbPRDpp5IHxL6fEFLlDZBrh bv7g== X-Gm-Message-State: ABy/qLZjxDLlRnPP5qZokECb1b29m5F/vqtSB51fuAV9+1TLPpqUsS1G zXQ2UTjTF1lkepHpVUpyyAud5z0OWbB9jS7MqAPNAT3a X-Google-Smtp-Source: APBJJlGdGpUQjEFcZ64RsDbOm5hSzEdKbm0QWSsIJ4Amo8kfY9Ota/tl2E8G8iDNAOIfCQ+b5cmYqWYyMKJPeMxdaRg= X-Received: by 2002:a2e:a30b:0:b0:2af:25cf:92ae with SMTP id l11-20020a2ea30b000000b002af25cf92aemr19605694lje.22.1689199538226; Wed, 12 Jul 2023 15:05:38 -0700 (PDT) MIME-Version: 1.0 References: <29da91e9-d649-49c5-a415-46a84d22d531@Spark> <906b41e4-dcbd-4a03-9d10-33723ce1c708@Spark> <3d9f4cac-7840-42c9-be9c-e9fc3bcc030a@app.fastmail.com> In-Reply-To: <3d9f4cac-7840-42c9-be9c-e9fc3bcc030a@app.fastmail.com> Date: Thu, 13 Jul 2023 00:05:27 +0200 Message-ID: To: Larry Garfield Cc: php internals Content-Type: multipart/alternative; boundary="0000000000006e4b460600516a5d" Subject: Re: [PHP-DEV] Reflection*::hasAttribute() From: benjamin.morel@gmail.com (Benjamin Morel) --0000000000006e4b460600516a5d Content-Type: text/plain; charset="UTF-8" > > I think that would require an RFC. > > To clarify, you're proposing to replace this: > > count((new ReflectionClass(Beep::class))->getAttributes(Ignore::class)) == > true > > with > > (new ReflectionClass(Beep::class))->hasAttribute(Ignore::class) > > Right? That doesn't seem like a huge improvement. > > --Larry Garfield Actually, if ((new ReflectionClass(Beep::class))->getAttributes(Ignore::class)) would work as well, so basically: $rc->hasAttribute(Ignore::class) === (bool) $rc->getAttributes(Ignore::class); - Benjamin > --0000000000006e4b460600516a5d--