Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:120648 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 90919 invoked from network); 20 Jun 2023 17:07:36 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 20 Jun 2023 17:07:36 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 6C3761804F2 for ; Tue, 20 Jun 2023 10:07:35 -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-vk1-f171.google.com (mail-vk1-f171.google.com [209.85.221.171]) (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, 20 Jun 2023 10:07:35 -0700 (PDT) Received: by mail-vk1-f171.google.com with SMTP id 71dfb90a1353d-4718d66e108so404204e0c.1 for ; Tue, 20 Jun 2023 10:07:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1687280854; x=1689872854; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=nkRrUR2DSM+nJn4Xs19bFRHE95EDvfmt6DljGwFJQlg=; b=EPDUja3uxR8Rs+mJNNJxQ1nGEES5XfZ5oBrf8rH/BcFv6wAf9ysD0t0nj0ug9+LjVy vOIEM6FGNnezOLrql5ESdLCZHMxt0DlqE+nAKgwCl0ZIzxkTjjMhv74pkK5oi5bIUscD eDW7luUQNpbZh+R/ShysNUKQafqBsgTB5KB5/Ds2KU9i6C4G4eB4agtSO1Qh7ZnDym+m 7+/TTYw31BuwNONQtsSh2P1KDRRU76Gstg3Pix/BRcpd2ym+b9Ng6JtVlHfacuzEalS3 GcFHfB1Ec0BJZ8npkGJ0IWsbPBf2Z1lLJy3NsAQMBJcL6iE+TdKTclWqwoNi47RqnBg7 SLLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687280854; x=1689872854; 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=nkRrUR2DSM+nJn4Xs19bFRHE95EDvfmt6DljGwFJQlg=; b=ANdrtbkf/oC+K21r+RQisguKmZ1KUb2Eh+LyD42xHwcLDrkhoGD+1mHEHkUnwOJjfR 5bpJvsfAcKBsWWHQng8z2RbLg/+u7xQByaEGosJx2T2CY5gEkeqC33gBhVJD8oJVRNGz zr2b7vFujcg5KsX3uiHiHectMv7f6WcOTd+tpLKqnS6PtqR9w4U0wl3MOPXJdPY16W17 SuHvSUrP/gJexL4Vt7Yc5NIVkxeuWzZm+Ws1tUwGYxY5iD1sGJU/LihR+tV/bp7boI38 oXMQ7GwBupP+RocfQC5MKHrBI5lAJ5mRGM3SEjFB5jNvtFO/cTXuEtnzZJkDQ4xT6Tik u3uQ== X-Gm-Message-State: AC+VfDxb0siP2f0R9BEOoaeo1tUtC8MHEgEczcdhXcZfs8VO4CBCvdPF XylmtSwiK6ysE4bLYUb5e2QiGvGMCP3JGM9hapo= X-Google-Smtp-Source: ACHHUZ5oT4dD6FKpIZVvbPynrMGglNeWl/QHuYuaOYUuNz7wx4wbdAlCsgDGhqF8gIx65RT7RpI78Fk2zTegmzdyhCg= X-Received: by 2002:a67:c410:0:b0:440:afb0:2d3c with SMTP id c16-20020a67c410000000b00440afb02d3cmr2613754vsk.2.1687280854091; Tue, 20 Jun 2023 10:07:34 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Tue, 20 Jun 2023 14:06:58 -0300 Message-ID: To: Levi Morrison Cc: David Gebler , Rowan Tommins , internals@lists.php.net Content-Type: multipart/alternative; boundary="000000000000f1cd7305fe92af4b" Subject: Re: [PHP-DEV] [RFC] Interface Default Methods From: deleugyn@gmail.com (Deleu) --000000000000f1cd7305fe92af4b Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Jun 20, 2023 at 12:10=E2=80=AFAM Levi Morrison wrot= e: > > I like the idea of this RFC - in fact it's one which has been near top = of > > my wishlist for PHP language features for a long time - but I think thi= s > is > > an issue with the proposed implementation which at the very least > warrants > > highlighting and discussion. > > I understand your concern but personally believe it's overblown. This > problem already exists with abstract classes, but doesn't seem to be > that much of an issue in practice. I hope static analysis can fill the > gap here, but don't think these checks are necessary to ship this > feature. > I agree that these checks would not be a requirement to ship this feature. I was thinking even further just as a thought experiment. Let's pretend for a second that these checks could easily be implemented, wouldn't it actually make it worse for the language as a whole? The only place where a method body would be forbidden to call `$this->foo()` ahead-of-time (compile-time or runtime with special error) would be on an interface default method. Everywhere else in the language would have the behavior of resolving the scope of `$this` and then attempting to actually execute the method. If the scope of `$this` has a `__call()` implementation, this would never lead to a "FatalError method not found" scenario, making these checks even weirder. What I'm concluding is that although it could have been nice to not allow these weird quirks, that ship has sailed decades ago and doing it on an interface default implementation (even if it was possible) would just create a major language inconsistency and it would always be best to implement this RFC without it regardless of technical limitations. --=20 Marco Deleu --000000000000f1cd7305fe92af4b--