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

2023-07-17 Thread Levi Morrison via internals
On Sun, Jul 2, 2023 at 6:11 PM Levi Morrison wrote: > > Chatter on the [Interface Default Methods RFC][1] has been quiet for > the past 6 days, and the feature freeze deadline is fast approaching > for PHP 8.3, so I'm moving this to vote. It'll be open for two weeks > as usual. > > Thanks to every

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

2023-07-13 Thread Larry Garfield
On Thu, Jul 13, 2023, at 3:09 PM, Robert Landers wrote: > I just want to say that between all of you, I get this feature now. > > Maybe someone should open an RFC where your vote doesn't count unless > you provide feedback on the list. (ban drive-by votes) > > We may not have the power to vote, but

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

2023-07-13 Thread Tim Düsterhus
Hi On 7/12/23 06:00, G. P. B. wrote: I find the Rust Seek trait(/type class) a very concise example of the usefulness, and where the implementation of a default method is far from concrete. Requiring an implementation to provide the implementation for seek(int $position) But being able to provid

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

2023-07-13 Thread Robert Landers
I just want to say that between all of you, I get this feature now. Maybe someone should open an RFC where your vote doesn't count unless you provide feedback on the list. (ban drive-by votes) We may not have the power to vote, but we can open RFCs. -- PHP Internals - PHP Runtime Development Ma

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

2023-07-13 Thread Wendell Adriel
>> I want to pitch in, agreeing with Larry's message here. >> >> - There are multiple real life use cases where the combo trait/interface >> could be replaced by interface default methods >> - Several modern language apply the technique in one form or another, so >> it's already proven to be valuab

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

2023-07-13 Thread Deleu
On Thu, Jul 13, 2023 at 8:46 AM Brent Roose via internals < internals@lists.php.net> wrote: > I want to pitch in, agreeing with Larry's message here. > > - There are multiple real life use cases where the combo trait/interface > could be replaced by interface default methods > - Several modern lan

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

2023-07-13 Thread Brent Roose via internals
I want to pitch in, agreeing with Larry's message here. - There are multiple real life use cases where the combo trait/interface could be replaced by interface default methods - Several modern language apply the technique in one form or another, so it's already proven to be valuable - There are

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

2023-07-12 Thread Larry Garfield
On Wed, Jul 12, 2023, at 4:00 AM, G. P. B. wrote: > On Mon, 3 Jul 2023 at 01:11, Levi Morrison wrote: > >> Chatter on the [Interface Default Methods RFC][1] has been quiet for >> the past 6 days, and the feature freeze deadline is fast approaching >> for PHP 8.3, so I'm moving this to vote. It'll

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

2023-07-12 Thread David Gebler
On Wed, Jul 12, 2023 at 5:01 AM G. P. B. wrote: > > Maybe the resistance to the proposal would be far less if the RFC, and > implementation, would check at compile time that the default > implementations only rely on known existing functions available to the > interface. > I asked in the discuss

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

2023-07-11 Thread G. P. B.
On Mon, 3 Jul 2023 at 01:11, Levi Morrison wrote: > Chatter on the [Interface Default Methods RFC][1] has been quiet for > the past 6 days, and the feature freeze deadline is fast approaching > for PHP 8.3, so I'm moving this to vote. It'll be open for two weeks > as usual. > > Thanks to everyone

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

2023-07-11 Thread Jorg Sowa
> So, here's a crazy thought: why do inheritance, interfaces, and traits > need to be separate at all? > > At some level, they're all ways of composing a class with different > restrictions, e.g. inheritance requires a single parent, interfaces must be > abstract, traits don't interact with typing,

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

2023-07-11 Thread Deleu
On Tue, Jul 11, 2023, 7:32 PM David Gebler wrote: > Looks - sadly to me - like this isn't going to pass. I don't have vote > karma and if I did it wouldn't make a difference to the outcome, but it > would be really good for those of us who can't vote on the feature to hear > from some of the peop

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

2023-07-11 Thread David Gebler
Looks - sadly to me - like this isn't going to pass. I don't have vote karma and if I did it wouldn't make a difference to the outcome, but it would be really good for those of us who can't vote on the feature to hear from some of the people who voted against it why they chose no. The feedback from

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

2023-07-11 Thread John Bafford
On Jul 11, 2023, at 13:42, Larry Garfield wrote: > > On Tue, Jul 11, 2023, at 5:28 PM, Robert Landers wrote: >> >> IMHO, using a shared base class reflects the inheritance better >> because they are siblings (at least these appear to be logical >> siblings out of context, IMHO) and should look l

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

2023-07-11 Thread Dusk
On Jul 11, 2023, at 12:03, Peter Kokot wrote: > I really liked this idea actually but I'm still not so sure about it, > what would be the "right" approach. So, here's a crazy thought: why do inheritance, interfaces, and traits need to be separate at all? At some level, they're all ways of compo

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

2023-07-11 Thread Larry Garfield
On Tue, Jul 11, 2023, at 5:28 PM, Robert Landers wrote: >> Real code I wrote a week ago (specifically, for a series of events in a >> domain model): >> >> https://gist.github.com/Crell/f5929e2ee44decd4e9353c41874f26c8 >> >> Two different interfaces, that I want to be able to check against, but the

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

2023-07-11 Thread Robert Landers
> Real code I wrote a week ago (specifically, for a series of events in a > domain model): > > https://gist.github.com/Crell/f5929e2ee44decd4e9353c41874f26c8 > > Two different interfaces, that I want to be able to check against, but their > implementations are trivial. One of them is used in 2 c

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

2023-07-11 Thread Larry Garfield
On Tue, Jul 11, 2023, at 3:16 PM, Robert Landers wrote: > On Tue, Jul 11, 2023 at 4:36 PM Larry Garfield wrote: >> You have to check your vendor folder for an interface, or trait, or abstract >> class. That doesn't change anything. >> >> As noted, now consider a Baz interface. For interface-and

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

2023-07-11 Thread Pierre
Le 11/07/2023 à 17:16, Robert Landers a écrit : On Tue, Jul 11, 2023 at 4:36 PM Larry Garfield wrote: You have to check your vendor folder for an interface, or trait, or abstract class. That doesn't change anything. As noted, now consider a Baz interface. For interface-and-trait, you add 2

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

2023-07-11 Thread Robert Landers
On Tue, Jul 11, 2023 at 4:36 PM Larry Garfield wrote: > You have to check your vendor folder for an interface, or trait, or abstract > class. That doesn't change anything. > > As noted, now consider a Baz interface. For interface-and-trait, you add 2 > more definitions. For interface-with-def

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

2023-07-11 Thread Larry Garfield
On Tue, Jul 11, 2023, at 2:04 PM, Robert Landers wrote: >> 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 f

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

2023-07-11 Thread Robert Landers
> 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 { > publi

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

2023-07-11 Thread Deleu
On Tue, Jul 11, 2023 at 10:54 AM Michał Marcin Brzuchalski < michal.brzuchal...@gmail.com> wrote: > Hi Robert, > > wt., 11 lip 2023 o 14:54 Robert Landers > napisał(a): > >> ... >> Abstract classes solve this problem perfectly. It's part of the type >> system, it's type-hintable, it's mockable, a

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

2023-07-11 Thread Michał Marcin Brzuchalski
Hi Robert, wt., 11 lip 2023 o 14:54 Robert Landers napisał(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 w

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

2023-07-11 Thread Robert Landers
> > a Trait was modified, what gets impacted? Is this not already the case for all tightly coupled code? This RFC proposes to make the least-coupled code in PHP more coupled, so soon, you'll be able to say the same for interfaces (if this passes). I don't understand this RFC. Symfony is a mess in

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

2023-07-03 Thread Deleu
> > Stop using `implements` at all and solely rely on `use`. > > My 0.02€ > > Cheers > > Andreas > A Trait is not part of the Type system, it's not type-hintable, it's not mockable, it's harder to do code review (a Trait was modified, what gets impacted?). A trait is just an "easy" way to copy/pas

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

2023-07-03 Thread Levi Morrison via internals
On Mon, Jul 3, 2023 at 2:54 AM Tim Düsterhus wrote: > > Hi > > On 7/3/23 02:11, Levi Morrison wrote: > > Chatter on the [Interface Default Methods RFC][1] has been quiet for > > the past 6 days, and the feature freeze deadline is fast approaching > > for PHP 8.3, so I'm moving this to vote. It'll

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

2023-07-03 Thread Michał Marcin Brzuchalski
pon., 3 lip 2023 o 14:26 Andreas Heigl napisał(a): > Hey Michał > > On 03.07.23 13:32, Michał Marcin Brzuchalski wrote: > > Hi Levi, > > > > pon., 3 lip 2023 o 02:11 Levi Morrison > napisał(a): > > > >> Chatter on the [Interface Default Methods RFC][1] has been quiet for > >> the past 6 days, an

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

2023-07-03 Thread Andreas Heigl
Hey Michał On 03.07.23 13:32, Michał Marcin Brzuchalski wrote: Hi Levi, pon., 3 lip 2023 o 02:11 Levi Morrison napisał(a): Chatter on the [Interface Default Methods RFC][1] has been quiet for the past 6 days, and the feature freeze deadline is fast approaching for PHP 8.3, so I'm moving this

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

2023-07-03 Thread Michał Marcin Brzuchalski
pon., 3 lip 2023 o 13:50 Pierre napisał(a): > Le 03/07/2023 à 13:32, Michał Marcin Brzuchalski a écrit : > > I voted "yes", my personal use case waits for this feature. My use > > case example: > > > > https://gist.github.com/brzuchal/89e9481bbd34a6ce3d95a68eabff038b > > > > With interface defaul

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

2023-07-03 Thread Pierre
Le 03/07/2023 à 13:32, Michał Marcin Brzuchalski a écrit : I voted "yes", my personal use case waits for this feature. My use case example: https://gist.github.com/brzuchal/89e9481bbd34a6ce3d95a68eabff038b With interface default methods I'd no longer need traits that implement a single or in ra

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

2023-07-03 Thread Michał Marcin Brzuchalski
Hi Andreas, pon., 3 lip 2023 o 06:33 Andreas Heigl napisał(a): > Am 03.07.23 um 02:11 schrieb Levi Morrison: > > Chatter on the [Interface Default Methods RFC][1] has been quiet for > > the past 6 days, and the feature freeze deadline is fast approaching > > for PHP 8.3, so I'm moving this to vo

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

2023-07-03 Thread Michał Marcin Brzuchalski
Hi Levi, pon., 3 lip 2023 o 02:11 Levi Morrison napisał(a): > Chatter on the [Interface Default Methods RFC][1] has been quiet for > the past 6 days, and the feature freeze deadline is fast approaching > for PHP 8.3, so I'm moving this to vote. It'll be open for two weeks > as usual. > > Thanks

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

2023-07-03 Thread Tim Düsterhus
Hi On 7/3/23 02:11, Levi Morrison wrote: Chatter on the [Interface Default Methods RFC][1] has been quiet for the past 6 days, and the feature freeze deadline is fast approaching for PHP 8.3, so I'm moving this to vote. It'll be open for two weeks as usual. I'm not really sold on the proposal

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

2023-07-02 Thread Andreas Heigl
Am 03.07.23 um 02:11 schrieb Levi Morrison: Chatter on the [Interface Default Methods RFC][1] has been quiet for the past 6 days, and the feature freeze deadline is fast approaching for PHP 8.3, so I'm moving this to vote. It'll be open for two weeks as usual. Thanks to everyone who discussed we

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

2023-07-02 Thread Ben Ramsey
> On Jul 2, 2023, at 21:43, Levi Morrison wrote: > > On Sun, Jul 2, 2023 at 7:08 PM Ben Ramsey wrote: >> >> I’m probably going to vote “yes” on this, but since the property accessors >> RFC won’t be ready for 8.3,[1] and that RFC covers use of properties in >> interfaces, how useful will inte

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

2023-07-02 Thread Levi Morrison
On Sun, Jul 2, 2023 at 7:08 PM Ben Ramsey wrote: > > On Jul 2, 2023, at 19:11, Levi Morrison wrote: > > Chatter on the [Interface Default Methods RFC][1] has been quiet for > the past 6 days, and the feature freeze deadline is fast approaching > for PHP 8.3, so I'm moving this to vote. It'll be

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

2023-07-02 Thread Ben Ramsey
> On Jul 2, 2023, at 19:11, Levi Morrison wrote: > > Chatter on the [Interface Default Methods RFC][1] has been quiet for > the past 6 days, and the feature freeze deadline is fast approaching > for PHP 8.3, so I'm moving this to vote. It'll be open for two weeks > as usual. > > Thanks to every

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

2023-07-02 Thread Deleu
On Sun, Jul 2, 2023 at 9:11 PM Levi Morrison wrote: > Chatter on the [Interface Default Methods RFC][1] has been quiet for > the past 6 days, and the feature freeze deadline is fast approaching > for PHP 8.3, so I'm moving this to vote. It'll be open for two weeks > as usual. > > Thanks to everyo

[PHP-DEV] [VOTE] Interface Default Methods

2023-07-02 Thread Levi Morrison
Chatter on the [Interface Default Methods RFC][1] has been quiet for the past 6 days, and the feature freeze deadline is fast approaching for PHP 8.3, so I'm moving this to vote. It'll be open for two weeks as usual. Thanks to everyone who discussed weaknesses in the RFC during the discussion phas