Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:118241 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 57580 invoked from network); 10 Jul 2022 19:19:30 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 10 Jul 2022 19:19:30 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 201B7180380 for ; Sun, 10 Jul 2022 14:13:36 -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, 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-f173.google.com (mail-lj1-f173.google.com [209.85.208.173]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Sun, 10 Jul 2022 14:13:35 -0700 (PDT) Received: by mail-lj1-f173.google.com with SMTP id q7so4172373lji.12 for ; Sun, 10 Jul 2022 14:13:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=lJWsdPNbNMkuHoPAde9cR5Ws+apbEF02wNsp3j8iOJ8=; b=NOYYGhoYarQHK2rbqHGYJv5NsOWiAItLjABReRuJTUkck14Iws9m2RJ3X6pIwlKvfL /M2jxLmOYuMEAyXxhnHo9n5PqIRVWFhSgY9hl/iy5UfKJdJl+l/2arAki1RTGYpCNbDq zG6/+k+ELxPtT/nNBr9nv2DuuqFc18lP6YF4qg0S8X6yfW9egod+wjB9yblh+r9jnzjx EBEPJ5RZvPbFY71EWphPV/+rTRdgg2CyYRoo05EMWRAmtVMIkbyb9iyTIKzNGVx9Buig eriGc84tswk8JXIiPkulE/cKpV56lgH3J+xcjghdSgnEKwb22C9F31CHDG7xTgX83Qvy vqoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=lJWsdPNbNMkuHoPAde9cR5Ws+apbEF02wNsp3j8iOJ8=; b=ZvZVj509hLg6px+N8kIYWTBohY1Tma8LU9810hvTVu2uNCC6ZTaegBV/rvwy4VoCY/ bLVNrQNkloUSXKaq9bnzqtJ2AfvaMqZTSekIeq8O+G5JePm06lNuKcqu6Ve3WHIio7os LSOfQ3XX+RuFS2LY3YjvmKOxY6ym06q9ZNyg5ea3GCF7CJCvdy2cO2UwwSn3vOR1ZP8y g4wevr+Ul40ZYzX6c1SjIqAA4VUT+S9qAJmGHQEn5j5FisAIdJCcOfYwFbeScszxpLT3 iUpu3wa2Hs2AsRTG83JZhTNKYuq796k/b+4IRtYrrz3SGhyR5KD+pdqlT6OAeSDH5+jd eBSg== X-Gm-Message-State: AJIora/NN4/4bFDbv4ny24xqpJa9ztome7Oeki7M5q3JI3QMkLKfE/cl RZpkt4LTM+mqXjxV+8end//KMxN1rQ2wHlb2nyA= X-Google-Smtp-Source: AGRyM1upwwglF4hkztN4f/EGHdKuDd6eEC1wBHpc7Rea/WZQdYt/bN2XvOdNMGG9wq9wUKdOJNoE7jP6tU4L+XlbgyE= X-Received: by 2002:a05:651c:b12:b0:25c:3b1:75ce with SMTP id b18-20020a05651c0b1200b0025c03b175cemr8262883ljr.353.1657487613801; Sun, 10 Jul 2022 14:13:33 -0700 (PDT) MIME-Version: 1.0 References: <34112e9f-057f-1045-ffdb-99aee9df2353@gmail.com> In-Reply-To: <34112e9f-057f-1045-ffdb-99aee9df2353@gmail.com> Date: Sun, 10 Jul 2022 23:13:17 +0200 Message-ID: To: Rowan Tommins Cc: internals@lists.php.net Content-Type: multipart/alternative; boundary="00000000000070b70205e379e829" Subject: Re: [PHP-DEV] [RFC] [VOTE] Constants in traits From: nikita.ppv@gmail.com (Nikita Popov) --00000000000070b70205e379e829 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sun, Jul 10, 2022 at 3:46 PM Rowan Tommins wrote: > On 10/07/2022 13:51, Bj=C3=B6rn Larsson via internals wrote: > > I think it's quite unlikely to deprecate such a rather big feature and > > from that perspective I think one should do it as good as possible. > > > > Even if one thinks that this is a bad feature not to be expanded, why > > not try to make it work better? So, I hope this RFC passes! > > > I agree. > > Having sat down and read through the RFC, it is extremely conservative > in its scope, and presents a clear case that it will fix a source of > bugs in things that people can already do, i.e. reference constants > inside a trait definition. > > It seems very unlikely that this change will make people suddenly use > traits in more "wrong" places, nor prevent any alternative horizontal > reuse / composition aid features being added in future. > I tend to agree. While I strongly dislike traits (or at least our implementation of them), they're here to stay and we should make them less bad where we can. Adding support for constants in traits makes sense to me, because it removes an arbitrary limitation and inconsistency, and removes the need for people to work around this in ways that are much worse -- for example, by having an implicit contract between the trait and the using class, as shown in the RFC. Regards, Nikita --00000000000070b70205e379e829--