On Tue, Jun 20, 2023 at 9:46 PM Levi Morrison <le...@php.net> wrote: > > On Tue, Jun 20, 2023 at 6:29 AM David Gebler <davidgeb...@gmail.com> wrote: > > > > On Tue, 20 Jun 2023, 04:10 Levi Morrison, <le...@php.net> wrote: > > > > > > 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 this > > > 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. > > > > > > > > > Yeah I suppose I'm just saying "Interface default methods" can be > > interpreted a few different ways and there's key differences between > > Java-style, versus syntax sugar for mixing an interface and a trait in to > > one unit, versus a user can effectively extend multiple abstract classes > > but with interface keyword. > > I will update the RFC soon. In my head it was so obvious that it would > be similar to regular inheritance and less like traits, to the extent > I didn't even realize I'd need to specify it. This is why discussion > periods can be valuable; the RFC doesn't always say what's in the RFC > author's head :)
I have significantly updated the RFC. There's one more topic that needs to go in there, tentatively called 'default cancelling': ```php interface Interface1 { function m1() { /* ... */ } } interface Interface2 extends Interface1 { function m1(); // may or may not change signature } ``` For various reasons which I'll put in the RFC, this will "cancel" the default, meaning any class which implements Interface2 instead of Interface1 will not receive that default. -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php