Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:118204 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 88956 invoked from network); 6 Jul 2022 07:53:08 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 6 Jul 2022 07:53:08 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id F34CF180547 for ; Wed, 6 Jul 2022 02:46:03 -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-yw1-f172.google.com (mail-yw1-f172.google.com [209.85.128.172]) (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 ; Wed, 6 Jul 2022 02:46:03 -0700 (PDT) Received: by mail-yw1-f172.google.com with SMTP id 00721157ae682-31c8bb90d09so80495227b3.8 for ; Wed, 06 Jul 2022 02:46:03 -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=DCN5lsABov4ftY2lTz8HEnWE1ZMmCzKs+TlNVhbtMuE=; b=NPVgS0wSRRYJh0pGmrmFvOmaXFVAcT0m9xTdav8V6T+Gb+AG5PFSg00NZ+rii3fXoP +t9bCzfryuBtgjp7KAJg0DH8scVaWhVaEMQootwkljITwSr1AwBm/7vL3WM4Eidya+dO zzs1dVHm20b93/Jzgx1Ulxp3MbV7CZB5ITE+1YHPLZuWzVGh5YdzPwMan1rUTvoocAwB 61XcYQ0DC+OdDlXz4gQuWa6NPypbbhMY6hd7GYtsiiYCD/80cTKDj3hJgte4/8lNONVp 5lGwRp725nU1cCLWk18axyfRspwKODw/NQ7/eCVnXHZfQt83akn+eTan6jrp/mD2RkXm cYFg== 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=DCN5lsABov4ftY2lTz8HEnWE1ZMmCzKs+TlNVhbtMuE=; b=uBjPlwQUDMsvgqakkt4KGcJKpLC+M3hulqDsITAMP6cUJ6IUD7a1ynzeMweo3mIHnz Byj4+Va6wY+gbmELEDBNIEo6HGd/nRvpJJP2N0SyK+LdhMTefeK/mm/eX7C5XjZ7PYZD OBGku3/TF20W5mhrwCYRDZEKY30nhhivJal3erzQdyAW5AVJQ8UcQRt6VuNA4puGTqx2 EDuMt6xNeDj7vj7D0mP8rEv0s9mvJSiy0tlGcZJFFOwjih9zLiOiTqvd91aQHE3byzlQ hU5bjQdCada3Wgv341vfq3Lp6/YjtcjIApuafEMGr3nNadXiVl+sy+ZekesFsvyttp/j 2M3Q== X-Gm-Message-State: AJIora8i77m5COABzWafbwjGRFS49cvnT22zrcPSb0A8vy3B4ck0wm2g rMJeqfwr3UPzP2R3C2dkFhRf42rbRcNqAW7GBnrDw5ItaybMNA== X-Google-Smtp-Source: AGRyM1uObmmoea0S+jmw6DCifrYPK1TnryHkL3thaiFHt0EGInXx3qJzpX1aVhstAZ3/wGssLsyH/pgITlJnqHz/m0I= X-Received: by 2002:a81:1804:0:b0:31c:b5d0:1ae1 with SMTP id 4-20020a811804000000b0031cb5d01ae1mr12398012ywy.144.1657100762691; Wed, 06 Jul 2022 02:46:02 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Wed, 6 Jul 2022 11:45:50 +0200 Message-ID: To: shinji igarashi Cc: internals Content-Type: multipart/alternative; boundary="000000000000513f3005e31fd641" Subject: Re: [PHP-DEV] [RFC] [VOTE] Constants in traits From: ocramius@gmail.com (Marco Pivetta) --000000000000513f3005e31fd641 Content-Type: text/plain; charset="UTF-8" Hey Shinji, On Tue, 5 Jul 2022 at 23:39, shinji igarashi wrote: > Hello internals, > > I've started the vote for the Constants in Traits RFC: > https://wiki.php.net/rfc/constants_in_traits > > The vote will end on 19. July 2022. > I voted "NO" on this. Reasoning: * traits are pretty much unnecessary in the language. Since their introduction in PHP 5.4 their usage went from "let's try this out" to "how do I burn this with fire?". I don't want traits to expand in scope: they already do enough damage with their built-in accidental complexity. * invariants shared by trait (example in the RFC) are generally to be separated to clear invariant objects/functions/static methods, instead of being put in a trait * a trait does not know the public API of its implementor either, so `self::SOME_CONSTANT` inside a trait points nowhere sensible, since there is no clear contract on the possible implementations. Referencing symbols of the implementing class in a trait is a clear mistake (again, an example from the RFC) * this expands trait compatibility checks, introducing a number of potential error scenarios that are unnecessary (due to the already mind-boggling over-complicated `use TRAIT1, TRAIT2, TRAIT3` semantics) In practice, while this may make on surface because you can declare constants everywhere, declaring more stuff on traits is problematic. From a technical and detail PoV, your RFC is well written and implemented: it just solves a problem that doesn't/shouldn't need solving. Greets, Marco Pivetta https://twitter.com/Ocramius https://ocramius.github.io/ --000000000000513f3005e31fd641--