Re: [PHP-DEV] [RFC] Interface Default Methods

2023-06-26 Thread Levi Morrison via internals
On Tue, Jun 20, 2023 at 9:46 PM Levi Morrison wrote: > > On Tue, Jun 20, 2023 at 6:29 AM David Gebler wrote: > > > > On Tue, 20 Jun 2023, 04:10 Levi Morrison, wrote: > > > > > > I like the idea of this RFC - in fact it's one which has been near top > > > > of > > > > my wishlist for PHP

Re: [PHP-DEV] [RFC] Interface Default Methods

2023-06-20 Thread Levi Morrison
On Tue, Jun 20, 2023 at 6:29 AM David Gebler wrote: > > On Tue, 20 Jun 2023, 04:10 Levi Morrison, 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

Re: [PHP-DEV] [RFC] Interface Default Methods

2023-06-20 Thread Deleu
On Tue, Jun 20, 2023 at 12:10 AM Levi Morrison 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 >

Re: [PHP-DEV] [RFC] Interface Default Methods

2023-06-20 Thread Rowan Tommins
On Tue, 20 Jun 2023 at 13:29, David Gebler wrote: > 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

Re: [PHP-DEV] [RFC] Interface Default Methods

2023-06-20 Thread David Gebler
On Tue, 20 Jun 2023, 04:10 Levi Morrison, 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 > >

Re: [PHP-DEV] [RFC] Interface Default Methods

2023-06-20 Thread Rowan Tommins
On 19/06/2023 22:12, David Gebler wrote: Sure, but in this example were B::bar() to be a private method, you would get a scope violation error. You would not if you were to use a trait, since any methods implemented in the trait would be executed in the same scope as the class using the

Re: [PHP-DEV] [RFC] Interface Default Methods

2023-06-19 Thread Alexandru Pătrănescu
On Tue, Jun 20, 2023 at 7:30 AM Levi Morrison wrote: > On Sat, Jun 17, 2023 at 6:05 AM Alexandru Pătrănescu > wrote: > > > > 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? > > Sorry for the delay in

Re: [PHP-DEV] [RFC] Interface Default Methods

2023-06-19 Thread Levi Morrison
On Sat, Jun 17, 2023 at 6:05 AM Alexandru Pătrănescu wrote: > > 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

Re: [PHP-DEV] [RFC] Interface Default Methods

2023-06-19 Thread Levi Morrison
> 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

Re: [PHP-DEV] [RFC] Interface Default Methods

2023-06-19 Thread David Gebler
On Mon, Jun 19, 2023 at 9:53 PM Rowan Tommins wrote: > On 19/06/2023 20:20, David Gebler wrote: > > Okay, thanks. That's really quite significant, since it changes the > feature > > to one which could allow changes made to interfaces to adversely impact > > existing clients of an interface

Re: [PHP-DEV] [RFC] Interface Default Methods

2023-06-19 Thread Rowan Tommins
On 19/06/2023 20:20, David Gebler wrote: Okay, thanks. That's really quite significant, since it changes the feature to one which could allow changes made to interfaces to adversely impact existing clients of an interface without those clients changing a thing. As the RFC says, it introduces

Re: [PHP-DEV] [RFC] Interface Default Methods

2023-06-19 Thread David Gebler
On Mon, Jun 19, 2023 at 3:53 AM Levi Morrison wrote: > > No, there's no attempt to ensure the method body adheres to calling > the public interface. Due to PHP's possible dynamic behaviors, I don't > think it's reasonable to attempt to enforce it at compile-time. I'm > not sure it's worth the

Re: [PHP-DEV] [RFC] Interface Default Methods

2023-06-18 Thread Levi Morrison via internals
On Sat, Jun 17, 2023 at 4:10 PM David Gebler wrote: > > On Thu, Jun 15, 2023 at 4:48 AM Levi Morrison via internals > wrote: >> >> >> I am moving my RFC for interface default methods to discussion: >> https://wiki.php.net/rfc/interface-default-methods. >> > > Can I ask, the RFC doesn't say -

Re: [PHP-DEV] [RFC] Interface Default Methods

2023-06-17 Thread David Gebler
On Thu, Jun 15, 2023 at 4:48 AM Levi Morrison via internals < internals@lists.php.net> wrote: > > I am moving my RFC for interface default methods to discussion: > https://wiki.php.net/rfc/interface-default-methods. > > Can I ask, the RFC doesn't say - does your implementation ensure default

Re: [PHP-DEV] [RFC] Interface Default Methods

2023-06-17 Thread Alexandru Pătrănescu
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

Re: [PHP-DEV] [RFC] Interface Default Methods

2023-06-16 Thread Levi Morrison
On Thu, Jun 15, 2023 at 5:41 PM Levi Morrison via internals wrote: > > On Thu, Jun 15, 2023 at 3:37 PM Ilija Tovilo wrote: > > > I am moving my RFC for interface default methods to discussion: > > > https://wiki.php.net/rfc/interface-default-methods. > > > > The RFC doesn't mention default

Re: [PHP-DEV] [RFC] Interface Default Methods

2023-06-16 Thread Levi Morrison via internals
On Fri, Jun 16, 2023 at 11:51 AM Deleu wrote: > > > On Thu, Jun 15, 2023 at 12:48 AM Levi Morrison via internals > wrote: >> >> Hello, PHP Internals, >> >> I am moving my RFC for interface default methods to discussion: >> https://wiki.php.net/rfc/interface-default-methods. >> >> This can be a

Re: [PHP-DEV] [RFC] Interface Default Methods

2023-06-16 Thread Deleu
On Thu, Jun 15, 2023 at 12:48 AM 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. > > This can be a useful tool for a few reasons: > 1.

Re: [PHP-DEV] [RFC] Interface Default Methods

2023-06-16 Thread Larry Garfield
On Thu, Jun 15, 2023, at 3:47 AM, Levi Morrison via internals wrote: > Hello, PHP Internals, > > I am moving my RFC for interface default methods to discussion: > https://wiki.php.net/rfc/interface-default-methods. > > This can be a useful tool for a few reasons: > 1. It can make implementing an

Re: [PHP-DEV] [RFC] Interface Default Methods

2023-06-15 Thread Levi Morrison via internals
On Thu, Jun 15, 2023 at 3:37 PM Ilija Tovilo wrote: > > I am moving my RFC for interface default methods to discussion: > > https://wiki.php.net/rfc/interface-default-methods. > > The RFC doesn't mention default implementations for static methods. > I'm not sure there's a use case but it might

Re: [PHP-DEV] [RFC] Interface Default Methods

2023-06-15 Thread Ilija Tovilo
Hi Levi > I am moving my RFC for interface default methods to discussion: > https://wiki.php.net/rfc/interface-default-methods. This or a similar concept makes sense to me. The proposal seems similar to Swift protocol extensions, or Rust traits, with the exception that function default

Re: [PHP-DEV] [RFC] Interface Default Methods

2023-06-15 Thread Michael Babker
> On Thursday, Jun 15, 2023 at 12:01 PM, Deleu (mailto:deleu...@gmail.com)> wrote: > > One can argue that this change might make it so that users start > considering adding methods with default implementation as > not-so-much-a-bc-break and do so without bumping a major version, in which > case

Re: [PHP-DEV] [RFC] Interface Default Methods

2023-06-15 Thread Deleu
> > I still believe this information should be added to the RFC as the risk > of adding new methods to an interface which collide with existing > methods in implementations of that interface is very real, though I > agree with Deleu that this BC impact is not so much of the RFC, but of > what can

Re: [PHP-DEV] [RFC] Interface Default Methods

2023-06-15 Thread Levi Morrison via internals
On Thu, Jun 15, 2023 at 9:16 AM Tim Düsterhus wrote: > > Hi > > On 6/15/23 17:08, Deleu wrote: > > The feature may introduce a new way for *Users of PHP* to break BC with > > *Other Users of PHP*. The language change itself has no impact on PHP code > > written prior to the feature. The

Re: [PHP-DEV] [RFC] Interface Default Methods

2023-06-15 Thread Levi Morrison via internals
> I still believe this information should be added to the RFC as the risk > of adding new methods to an interface which collide with existing > methods in implementations of that interface is very real, though I > agree with Deleu that this BC impact is not so much of the RFC, but of > what can

Re: [PHP-DEV] [RFC] Interface Default Methods

2023-06-15 Thread Tim Düsterhus
Hi On 6/15/23 17:08, Deleu wrote: The feature may introduce a new way for *Users of PHP* to break BC with *Other Users of PHP*. The language change itself has no impact on PHP code written prior to the feature. The additional note about how users may break BC by using the feature would be a

Re: [PHP-DEV] [RFC] Interface Default Methods

2023-06-15 Thread Deleu
I loved the proposal and I think this has the potential to be a huge developer experience improvement, perhaps at least as great as property constructor promotion and match(). Just a side note though, in the Backward Compatibility section, I would think that only "None" should be declared. From

Re: [PHP-DEV] [RFC] Interface Default Methods

2023-06-15 Thread Juliette Reinders Folmer
On 15-6-2023 5:47, Levi Morrison via internals wrote: Hello, PHP Internals, I am moving my RFC for interface default methods to discussion: https://wiki.php.net/rfc/interface-default-methods. This can be a useful tool for a few reasons: 1. It can make implementing an interface easier when

[PHP-DEV] [RFC] Interface Default Methods

2023-06-14 Thread Levi Morrison via internals
Hello, PHP Internals, I am moving my RFC for interface default methods to discussion: https://wiki.php.net/rfc/interface-default-methods. This can be a useful tool for a few reasons: 1. It can make implementing an interface easier when certain methods can be implemented by other methods in the