Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:120610 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 27621 invoked from network); 17 Jun 2023 12:05:36 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 17 Jun 2023 12:05:36 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 3A6F1180505 for ; Sat, 17 Jun 2023 05:05: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-oi1-f179.google.com (mail-oi1-f179.google.com [209.85.167.179]) (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 ; Sat, 17 Jun 2023 05:05:35 -0700 (PDT) Received: by mail-oi1-f179.google.com with SMTP id 5614622812f47-39ca120c103so1188424b6e.2 for ; Sat, 17 Jun 2023 05:05:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1687003535; x=1689595535; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=zEqbAuNUlopS3/JxQdpWXdxDXlELVoc08hHg+v3maHg=; b=YddN1rH+qb4GKcxfV8AKnyMFby5KD6z1EGCvmtVAJd+3ELWCKr/agkKFImAgtoLCfO 8FgQeYgrylc88K4bI/L4uk65NmBEVXfbOwEyH73xRS02fZ0xHzPBpgbZGTuM+rQlIf+K AsP1TIiNYm6vjBWTsuwX8ZmyuAEkRFwNn/QLNiYhZWQO0aEBBrjsjYmFCaeFvISdqhHX r5K/e9gdJkdErBV8uzM5wcX1CdJremr79p+Q8r8at7G6qM/SIavsbTLWvI9T+bNtXJlM /N/DbRQhosSPlAefLP4hAzl3QFbUE9OA8Kx8uIsRxAQK7G3VbVawXLYqjXzfYsj+LhEi hObA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687003535; x=1689595535; 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=zEqbAuNUlopS3/JxQdpWXdxDXlELVoc08hHg+v3maHg=; b=Aeh1YiJVv4LtYUzclqChniUaviHzDmHu3vB3mWZg9HIolZxH9ncqUgcOlLWFJ8eN+T kK8QYCGduQDm0qManazsxsOfUphU5ugQQt94d55/fH06H5drAngD8sEbcMKaFuj7YbpD mC69OBdmn5GWwqJyQGPFW7rq6ewlORrKeW8cyWUA1sZ5CH9emPIEM30iT4GGXqlUEi7o NTGyoXRSZ51BF2/XV1bhRGykPMm3m8WJQrgqve+i1s1EwXITu+yYd03GodvXnwJwHnQ7 bfercT6xt9y+knzfcYK66KHUHkafJTt3Dpmd97/4Pdnvl4wmWjKaA67pwYttXxxmym5p LhRg== X-Gm-Message-State: AC+VfDzPjlyihsS0YvjvojBK2R8Oh4LN/NPW+auq/CNJMyXaXi8+rXki +49YNfy7r4zKM1N1zrJvlfICbLD08/u1Z+McUjHEBOJbTT0= X-Google-Smtp-Source: ACHHUZ4sgOfT0+F7I+ukhtBYTUI1RzvJfU+dyhZ7vCoaQILnxjK6BDWIfAWCiu+TNzdv8WHQxpmFFSqO1jJ+eIgLaOk= X-Received: by 2002:aca:674a:0:b0:39a:51a0:d4d3 with SMTP id b10-20020aca674a000000b0039a51a0d4d3mr5556632oiy.33.1687003534660; Sat, 17 Jun 2023 05:05:34 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Sat, 17 Jun 2023 15:05:21 +0300 Message-ID: To: Levi Morrison Cc: PHP internals Content-Type: multipart/alternative; boundary="0000000000006b1a2205fe521e0a" Subject: Re: [PHP-DEV] [RFC] Interface Default Methods From: drealecs@gmail.com (=?UTF-8?Q?Alexandru_P=C4=83tr=C4=83nescu?=) --0000000000006b1a2205fe521e0a Content-Type: text/plain; charset="UTF-8" On Thu, Jun 15, 2023, 06:48 Levi Morrison via internals < internals@lists.php.net> wrote: > Hello, PHP Internals, > > I am moving my RFC for interface default methods to discussion: > https://wiki.php.net/rfc/interface-default-methods. > > Thank you for your time. I look forward to productive feedback. > > Hi Levi, Thank you for this! I like the proposal and I think it fits well. I'm used to it from Java and I don't know any reason for it to be considered a bad practice since it was introduce, about 9-10 years ago. 1. Do we want to allow also private methods in the interface so that it allows code reuse or better code organization in smaller methods? Java introduced this only in the next version. The private methods would be invisible to implementing classes and to anything else, of course. We can also add them at a later point but it might be better to have the feature complete now. Sidenote: I don't think protected method should ever exist on interfaces; that should remain for abstract classes use case. 2. The only use case for myself for ever using traits would be if traits would offer a default implementation for an interface. Now with a default implementation offered by interface itself, sounds even better. However, I can see how there could be more than one provided default implementation that can be offered. Would a method implemented by a trait have higher precedence over the interface default implementation? Would a trait offered implementation be directly usable by the interface? Thanks, Alex --0000000000006b1a2205fe521e0a--