Re: [PHP-DEV] [RFC] [Discussion] Clone with

2023-04-25 Thread Alexandru Pătrănescu
On Wed, Apr 26, 2023 at 3:25 AM Larry Garfield wrote: > On Tue, Apr 25, 2023, at 11:23 AM, Nicolas Grekas wrote: > > > What about using a real closure to define the scope we need for cloning? > > That closure would take the cloned instance as argument to allow > > manipulating it at will. > > I

Re: [PHP-DEV] [RFC] [Discussion] Clone with

2023-04-25 Thread Larry Garfield
On Tue, Apr 25, 2023, at 11:23 AM, Nicolas Grekas wrote: > What about using a real closure to define the scope we need for cloning? > That closure would take the cloned instance as argument to allow > manipulating it at will. I believe someone mentioned that one previously in the thread. The

Re: [PHP-DEV] Final anonymous classes

2023-04-25 Thread Juliette Reinders Folmer
On 24-4-2023 12:28, Daniil Gentili wrote: Hi all, I've submitted https://github.com/php/php-src/pull/11126 to add support for final anonymous classes, though as noted by iluuu1994, it would probably make more sense to just make all anonymous classes final by default, what do you think?

Re: [PHP-DEV] [Discussion] Callable types via Interfaces

2023-04-25 Thread Larry Garfield
On Tue, Apr 25, 2023, at 6:20 PM, Michał Marcin Brzuchalski wrote: > Personally I don't like this way of shaping callable types. Given examples > are really confusing me. Call of a castTo() with argument representing an > interface with a method is confusing as the method magically appears on a >

Re: [PHP-DEV] Final anonymous classes

2023-04-25 Thread Claude Pache
> Le 25 avr. 2023 à 15:46, Nicolas Grekas a > écrit : > >  > Because they conceptually don't create a new type, I wonder if (final) > anonymous classes could be allowed to extend final classes? In order to not > allow hacking around and still create a type with class_alias(), we should >

Re: [PHP-DEV] [Discussion] Callable types via Interfaces

2023-04-25 Thread Michał Marcin Brzuchalski
Hi Nicolas, wt., 25 kwi 2023, 19:00 użytkownik Nicolas Grekas < nicolas.grekas+...@gmail.com> napisał: > Hi all, > > > https://wiki.php.net/rfc/allow_casting_closures_into_single-method_interface_implementations > > > > >

Re: [PHP-DEV] [Discussion] Callable types via Interfaces

2023-04-25 Thread Nicolas Grekas
Hi all, https://wiki.php.net/rfc/allow_casting_closures_into_single-method_interface_implementations > > https://wiki.php.net/rfc/allow-closures-to-declare-interfaces-they-implement > https://wiki.php.net/rfc/structural-typing-for-closures Thanks Larry for the nice introduction to those ideas.

Re: [PHP-DEV] [RFC] [Discussion] Clone with

2023-04-25 Thread Nicolas Grekas
Hi again, Quite some time after mentioning the "clone with" construct the first time > (at the end of the > https://wiki.php.net/rfc/write_once_properties#run-time_behaviour > section), > finally I managed to create a working implementation for this feature which > would make it possible to

Re: [PHP-DEV] [RFC] [Discussion] Clone with

2023-04-25 Thread Nicolas Grekas
Hi Mate, Quite some time after mentioning the "clone with" construct the first time > (at the end of the > https://wiki.php.net/rfc/write_once_properties#run-time_behaviour > section), > finally I managed to create a working implementation for this feature which > would make it possible to

Re: [PHP-DEV] Final anonymous classes

2023-04-25 Thread Larry Garfield
On Tue, Apr 25, 2023, at 1:21 PM, Ilija Tovilo wrote: > Hi Claude > >> > Hi all, >> > >> > I've submitted https://github.com/php/php-src/pull/11126 to add support >> > for final anonymous classes, though as noted by iluuu1994, it would >> > probably make more sense to just make all anonymous

Re: [PHP-DEV] Final anonymous classes

2023-04-25 Thread Nicolas Grekas
Hi all, > > I've submitted https://github.com/php/php-src/pull/11126 to add support > for final anonymous classes, though as noted by iluuu1994, it would > probably make more sense to just make all anonymous classes final by > default, what do you think? > > > > Extending an anonymous class is

Re: [PHP-DEV] Final anonymous classes

2023-04-25 Thread Ilija Tovilo
Hi Claude > > Hi all, > > > > I've submitted https://github.com/php/php-src/pull/11126 to add support for > > final anonymous classes, though as noted by iluuu1994, it would probably > > make more sense to just make all anonymous classes final by default, what > > do you think? > > Extending

Re: [PHP-DEV] Request for RFC Karma - Enum value semantics proposal

2023-04-25 Thread Tim Düsterhus
Hi On 4/25/23 14:54, Garet Claborn wrote: I am requesting RFC karma to post the present version of an RFC made in response to the GitHub issue found at https://github.com/php/php-src/issues/9208 You should have already been granted RFC karma yesterday by derick, he told me that the Wiki

[PHP-DEV] Request for RFC Karma - Enum value semantics proposal

2023-04-25 Thread Garet Claborn
Relating to the existing thread in my introduction: Re: [PHP-DEV] Introduction - SuitespaceRnD I am requesting RFC karma to post the present version of an RFC made in response to the GitHub issue found at https://github.com/php/php-src/issues/9208 Though any guidance or contributions from those