Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:120773 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 74604 invoked from network); 11 Jul 2023 13:54:46 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 11 Jul 2023 13:54:46 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 7A6C118054F for ; Tue, 11 Jul 2023 06:54:45 -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-f182.google.com (mail-yw1-f182.google.com [209.85.128.182]) (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 ; Tue, 11 Jul 2023 06:54:45 -0700 (PDT) Received: by mail-yw1-f182.google.com with SMTP id 00721157ae682-579ef51428eso70599587b3.2 for ; Tue, 11 Jul 2023 06:54:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1689083684; x=1691675684; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=v9K6MlK1Lx8doWog1JkAovQ4Np0kVH4xDWySa9x848c=; b=Y57i3jMu4XYIwL5M6KcY249qE+/lynfc2rv7xiXXn8NSQUSFYlNNqobfE51V4/Km3H 1PnTvZckAd1d3D5+W3URAttT+ApW5XvLKvq0ChtR+ZjiRw1e5tTo9l3FdmcZBYPjisMi xw4eXnPrpv8drcxcSi/bP6H43ydJFDehF01+IvcMMQO1H5PvkCCHOKzlUn5Uj/3TbYW3 +vmZ8cztwtzhLUbwz4Qtri+ltc4u4x9HgSX/yAVbU2ccHDLX4+4vbKQQm5p0430SoPnV Etz7pqjGD9SVPU3cYY8OdGO/BvLU3HxXHznilrT7BuJXzzmNyp51zVLIv1ZuJiRdOljv E26A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689083684; x=1691675684; 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=v9K6MlK1Lx8doWog1JkAovQ4Np0kVH4xDWySa9x848c=; b=b2EciF6U2yS0Iuj494sRXoZCASJaXFJXE2WqsatLAu1EM7Lhd//FEe0z7GJgI6Hsmz zz5MN707HUU9/+n6DgSx7spUUfir91E1SrhNkIR5z80autHlpE0JZ9fhyQ34uToepNUV wBesBCyMlpHipKkMLzY8Yj3iEQObeDSpPfvDzs9WpZCV/0kdwqJzcmJIIi9znkpbBoHX pAwmagP4H36+B8pFgd8llMHK1gP9Mp3rIU1PA9YQOrTK1yxAHZezejNIi80EstmtnJ1k 1X6nRVmvEVXguR9tr8c+rKPRbCzkUhigrFCvhgeSWxyEg3ARszaKhZzdXBmGgKOb27l4 Pl3g== X-Gm-Message-State: ABy/qLajMdlcN2D+9RgHz89NkxSOxK8K3R3TWGutbs3eNZ1pz24kJeUA 3rjrcZx4P20kYU70ADCeVQw8Ft8tklsSOL7vF1biot8ewxDKng== X-Google-Smtp-Source: APBJJlFyoo5o5ALdMr8VKKFtAzmPxw7+zaJhhTWy6HWXnHjBKXZstijyM6dKsM1FOvlgd3UwLGLihvJNGA2YPwjsQlM= X-Received: by 2002:a0d:d555:0:b0:57a:6ce:aff3 with SMTP id x82-20020a0dd555000000b0057a06ceaff3mr17399457ywd.47.1689083684315; Tue, 11 Jul 2023 06:54:44 -0700 (PDT) MIME-Version: 1.0 References: <3a3e7781-c2b4-2880-8048-d19458ac287d@heigl.org> In-Reply-To: Date: Tue, 11 Jul 2023 15:54:32 +0200 Message-ID: To: Robert Landers Cc: Deleu , Andreas Heigl , internals@lists.php.net Content-Type: multipart/alternative; boundary="000000000000ffe8430600367062" Subject: Re: [PHP-DEV] [VOTE] Interface Default Methods From: michal.brzuchalski@gmail.com (=?UTF-8?Q?Micha=C5=82_Marcin_Brzuchalski?=) --000000000000ffe8430600367062 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Robert, wt., 11 lip 2023 o 14:54 Robert Landers napisa=C5=82(a): > ... > Abstract classes solve this problem perfectly. It's part of the type > system, it's type-hintable, it's mockable, and it's pretty easy to see > what inherits it as people who inherit it already know what the base > behavior was when they wrote the code. > Not exactly, How you wanna solve by abstract class two interfaces which can be implemented using let's say two traits - let's say interface Foo { public function foo(): string; } trait HasFoo { public function foo(): string { return 'foo'; } } interface Bar { public function bar(): bool; } traitHasBar { public function bar(): bool { return true; } } Now I can need to implement Foo or Bar separately or together. Using abstract class that would require 3 abstract classes: Foo, Bar, and FooWithBar. With this RFC that would require just two interfaces with default methods. Now you can easily see how bad this goes if you wanna add 3rd interface. Cheers, Micha=C5=82 Marcin Brzuchalski --000000000000ffe8430600367062--