Re: [PHP-DEV] [Discussion] Implementing interfaces via traits

2024-09-12 Thread Brent Roose
Hi Folks Thanks for the replies. If interface default methods are not entirely off the table, then I agree that's a far better option, for sure! I'll hold off on writing my arguments for them until a thread pops up, I think it makes a lot of sense though. So consider the idea of traits + interfac

Re: [PHP-DEV] [Discussion] Implementing interfaces via traits

2024-09-10 Thread Gina P. Banyard
On Tuesday, 27 August 2024 at 09:25, Brent Roose wrote: > Back to PHP, using traits as types seems impossible, since traits are a > compile-time copy/paste mechanism, which means there’s no type information > available about them at runtime. > > However, allowing traits to implement interfaces

Re: [PHP-DEV] [Discussion] Implementing interfaces via traits

2024-08-31 Thread Mike Schinkel
> On Aug 30, 2024, at 10:15 AM, Larry Garfield wrote: > I would be very much in favor of revisiting Interface Default Methods, > though, as I think it would be a strong feature, and it's one found in nearly > all of our sibling languages at this point. PHP is weird for not having > them. I be

Re: [PHP-DEV] [Discussion] Implementing interfaces via traits

2024-08-30 Thread Larry Garfield
On Fri, Aug 30, 2024, at 1:09 AM, Michał Marcin Brzuchalski wrote: > Hi Brent, > > wt., 27 sie 2024 o 09:28 Brent Roose napisał(a): >> Good morning internals >> >> >> I’d like to test the waters about an RFC idea: allowing traits to implement >> interfaces, and consequently a class that uses su

Re: [PHP-DEV] [Discussion] Implementing interfaces via traits

2024-08-29 Thread Michał Marcin Brzuchalski
Hi Brent, wt., 27 sie 2024 o 09:28 Brent Roose napisał(a): > Good morning internals > > I’d like to test the waters about an RFC idea: allowing traits to > implement interfaces, and consequently a class that uses such a trait will > automatically implement the interface as well. > > The original

Re: [PHP-DEV] [Discussion] Implementing interfaces via traits

2024-08-29 Thread Valentin Udaltsov
On Tue, 27 August in 2024 at 10:31, Brent Roose wrote: > Good morning internals > > I’d like to test the waters about an RFC idea: allowing traits to > implement interfaces, and consequently a class that uses such a trait will > automatically implement the interface as well. > > The original idea