Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:114202 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 91857 invoked from network); 27 Apr 2021 16:18:28 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 27 Apr 2021 16:18:28 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 01B311804D8 for ; Tue, 27 Apr 2021 09:22:48 -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-Virus: No X-Envelope-From: Received: from mail-lf1-f50.google.com (mail-lf1-f50.google.com [209.85.167.50]) (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, 27 Apr 2021 09:22:47 -0700 (PDT) Received: by mail-lf1-f50.google.com with SMTP id 4so34702431lfp.11 for ; Tue, 27 Apr 2021 09:22:47 -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 :cc; bh=xxCv86zhCjX6elSOZ4C6InCLMUpEpHNo8XCs7c1zVqY=; b=ZEuVzVveb0PISx2xS07rsHAqjVtdbmwUdi9FHpXxn2c5x9QJ5slKljNRbI0Oa6O72d pswZcgxQlF/VMSFIc4LkwcsGC14a78uHDylyR1d+67zg9kO9Ae4bQy8s2OZf1RjMYhw4 C4e05cIKOe98Ukdl9zqYMG0vniCejIMYY/NvpKLAnoULfvlZr8H9ntkp2BiZL01v6m8z bUh65tyaafZYB+K2TpOIxEJ32gIirzKt8TcMspGpF6ZdqzbB/Mp/SW3Ncu+lnrwmO8uj mvuVzMmYgrzb0ONGGyTtl53NfyqEaINMElG74damavThQWlGmMXpZODWu3lu1OkIwUNt qnHw== 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:cc; bh=xxCv86zhCjX6elSOZ4C6InCLMUpEpHNo8XCs7c1zVqY=; b=QEIf1cHY5F8f5Ij9aw2DBtNX9V3PrCFPz7UVPfyjE1Czmm53uJXCbbIPYq6V0Esbhf e4DEG4cz7UNY4NBIv3Xw0pVi1pUNtwyX1tPTv/2vjdrsc34yaakHjla56B4QHFwWjkkC Yo/pvYi+9BoIp7um9bl9u1RCU4P12UZ7VGNq39zln8yQAlomoM+bWvyPp0zDCqyJQKUd VIxUXqeC02XRfuPVuwgOCu3v4GEtssQ+rlbULutOV4Wr0yHAwlmStudjwPjnO0eCotPv +xSZlzfimnuffEqiPDQ+cWn4jGM4zNFsHpII5FcQWwO58ZwWI7SLyf6G1A31RSrEkgv4 sZPQ== X-Gm-Message-State: AOAM530vyuZtorpj9JJRLT+5nd830NQUOMA+arBjM91m/jU5lSufB8Nx JinREw/hAfVccX4SkHRoLh+ckEAdmfr5fAHvVg== X-Google-Smtp-Source: ABdhPJyLAfTGiDq4CKTAX053fDpHVq9uv2nmTRgRwYhVCqPrRfPz6S7atsS0SfM9BiKx5Kyeg07usQq3XCAb4L8zSIg= X-Received: by 2002:a05:6512:31cc:: with SMTP id j12mr9614811lfe.335.1619540565190; Tue, 27 Apr 2021 09:22:45 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Tue, 27 Apr 2021 18:22:34 +0200 Message-ID: To: Saif Eddin Gmati Cc: PHP Internals Content-Type: multipart/alternative; boundary="000000000000166b2305c0f6ac80" Subject: Re: [PHP-DEV] [RFC][Draft] Sealed Classes From: guilliam.xavier@gmail.com (Guilliam Xavier) --000000000000166b2305c0f6ac80 Content-Type: text/plain; charset="UTF-8" On Sat, Apr 24, 2021 at 12:55 PM Saif Eddin Gmati wrote: > Hello Internals, > > I'm sending this email to open discussion about sealed classes, > interfaces, and traits feature for PHP 8.1. > > I have create a Draft RFC here: https://wiki.php.net/rfc/sealed_classes > > A major concern for few people have been the syntax, in which it > introduces 2 new keywords into the languages, therefor, i have added a > section about alternative syntax which could be used to avoid this problem. > > Regards, > > Saif. > Hello, To me the first sentence of the RFC is debatable: > The purpose of inheritance is code reuse, for when you have a class that shares common functionality, and you want others to be able to extend it and make use of this functionality in their own class. That sounds like [abstract] base classes, which certainly permit that, but I wouldn't state that "the purpose" of [designing] class hierarchies is "code reuse", which can also (better?) be achieved with traits or even simply composition (by the way, the introduction then mentions that "PHP has the `Throwable` interface, which defines common functionality between `Error` and `Exception` and is implemented by both", but there is no "code reuse" in an interface). I also agree with others that Shape is probably not a good example, and the ResultInterface example feels like an enum/ADT (and the FilesystemTrait example I guess is to replace `@internal` phpDoc). I'm not saying that this RFC is bad, but probably not as convincing as it could be. Regards, -- Guilliam Xavier --000000000000166b2305c0f6ac80--