Re: [PHP-DEV] [RFC] [Discussion] Optional interfaces

2025-03-15 Thread Juris Evertovskis
On 2025-03-14 16:24, Viktor Khramov wrote: Hey Juris. I have a question about this feature. At the example blow interface A { public function x(Foo $foo); } interface B { public function x(Bar $foo); } class Test implements ?A, ?B { } what would happen if both interfaces existed? Hi Vi

Re: [PHP-DEV] [RFC] [Discussion] Optional interfaces

2025-03-15 Thread Viktor Khramov
Hey Juris. I have a question about this feature. At the example blow interface A > { >public function x(Foo $foo); > } > > interface B > { >public function x(Bar $foo); > } > > class Test implements ?A, ?B > { > } > what would happen if both interfaces existed? пт, 14 мар. 2025 г. в

Re: [PHP-DEV] [RFC] [Discussion] Optional interfaces

2025-03-14 Thread Juris Evertovskis
On 2025-03-14 16:04, Jorg Sowa wrote: Hello Juris, There is some uncertainty for me on how this approach would work with namespaces. Let's get this example: https://3v4l.org/bI1Rj I would expect to get the error message that I forgot to insert `use Stringable;`. But with your idea everything

Re: [PHP-DEV] [RFC] [Discussion] Optional interfaces

2025-03-14 Thread Bob Weinand
Hey Gina, On 12.3.2025 06:16:15, Gina P. Banyard wrote: On Tuesday, 11 March 2025 at 16:37, Juris Evertovskis wrote: Hey, Just a headsup that I plan to start the vote in a couple of days. Please let me know if there are concerns that might affect your stance on this proposal. https://wik

Re: [PHP-DEV] [RFC] [Discussion] Optional interfaces

2025-03-14 Thread Jorg Sowa
Hello Juris, There is some uncertainty for me on how this approach would work with namespaces. Let's get this example: https://3v4l.org/bI1Rj I would expect to get the error message that I forgot to insert `use Stringable;`. But with your idea everything is fine. I don't like such ambiguity and I

RE: [PHP-DEV] [RFC] [Discussion] Optional interfaces

2025-03-11 Thread Gina P. Banyard
On Tuesday, 11 March 2025 at 16:37, Juris Evertovskis wrote: > Hey, > > Just a headsup that I plan to start the vote in a couple of days. Please let > me know if there are concerns that might affect your stance on this proposal. > > https://wiki.php.net/rfc/optional-interfaces I will be voting

RE: [PHP-DEV] [RFC] [Discussion] Optional interfaces

2025-03-11 Thread Juris Evertovskis
Hey, Just a headsup that I plan to start the vote in a couple of days. Please let me know if there are concerns that might affect your stance on this proposal. https://wiki.php.net/rfc/optional-interfaces BR, Juris

RE: [PHP-DEV] [RFC] [Discussion] Optional interfaces

2025-03-04 Thread Juris Evertovskis
Hi all, It's almost awkward to bother the list with this humble RFC amidst so many exciting proposals :) With help from Ilija and Niels the implementation is now working and tested, so the RFC seems getting closer to the voting phase. Ilija raised a point about optional interfaces not b

Re: [PHP-DEV] [RFC] [Discussion] Optional interfaces

2025-02-11 Thread Ilija Tovilo
Hi Juris On Sun, Feb 9, 2025 at 10:16 PM Juris Evertovskis wrote: > > https://wiki.php.net/rfc/optional-interfaces Thanks for your efforts. I've reviewed the patch, it seems there are still a few issues and it would be great if we could solve them before this goes into voting. A few thoughts o

RE: [PHP-DEV] [RFC] [Discussion] Optional interfaces

2025-02-09 Thread Juris Evertovskis
Hey, Thanks for all the feedback! The RFC is now expanded to explicitly address the concerns on how the optional interfaces interact with type checks, eval'd interfaces, opcache, autoloading, reflection and the Override attribute. Did Did I miss something? Please let me know if anything is

Re: [PHP-DEV] [RFC] [Discussion] Optional interfaces

2024-12-29 Thread Niels Dossche
On 28/12/2024 21:56, Juris Evertovskis wrote: > Hi, > >   > > I would like to propose a new syntax that let’s you implement an interface > only if it exists. > >   > > `class MyClass extends ?OptionalInterface {}` > >   > > If the `OptionalInterface` exists, the class implements it. If no su

Re: [PHP-DEV] [RFC] [Discussion] Optional interfaces

2024-12-28 Thread Alexandru Pătrănescu
On Sat, Dec 28, 2024, 22:58 Juris Evertovskis wrote: > Hi, > > > > I would like to propose a new syntax that let’s you implement an interface > only if it exists. > > > > `class MyClass extends ?OptionalInterface {}` > > > > If the `OptionalInterface` exists, the class implements it. If no such >

Re: [PHP-DEV] [RFC] [Discussion] Optional interfaces

2024-12-28 Thread Larry Garfield
On Sat, Dec 28, 2024, at 2:56 PM, Juris Evertovskis wrote: > Hi, > > I would like to propose a new syntax that let’s you implement an > interface only if it exists. > > `class MyClass extends ?OptionalInterface {}` > > If the `OptionalInterface` exists, the class implements it. If no such > in

[PHP-DEV] [RFC] [Discussion] Optional interfaces

2024-12-28 Thread Juris Evertovskis
Hi, I would like to propose a new syntax that let's you implement an interface only if it exists. `class MyClass extends ?OptionalInterface {}` If the `OptionalInterface` exists, the class implements it. If no such interface can be found, it is ignored. https://wiki.php.net/rfc/opti