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

2025-05-15 Thread Stephen Reay
> On 15 May 2025, at 23:49, Andreas Hennings wrote: > > On Thu, 15 May 2025 at 13:56, Stephen Reay > wrote: >> >> >> >> >>> On 15 May 2025, at 16:44, Andreas Hennings wrote: >>> >>> On Thu, 15 May 2025 at 08:24, Stephen Reay >>> wrote: >>> [..] >

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

2025-05-15 Thread Larry Garfield
On Thu, May 15, 2025, at 2:56 PM, Rob Landers wrote: > On Thu, May 15, 2025, at 17:32, Tim Düsterhus wrote: >> Hi >> >> Am 2025-05-15 14:14, schrieb Rob Landers: >> > For example, if you have a Money type, you'd want to be able to ensure >> > it cannot be negative when updating via `with()`. This

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

2025-05-15 Thread Rob Landers
On Thu, May 15, 2025, at 17:32, Tim Düsterhus wrote: > Hi > > Am 2025-05-15 14:14, schrieb Rob Landers: > > For example, if you have a Money type, you'd want to be able to ensure > > it cannot be negative when updating via `with()`. This is super > > important for ensuring constraints are met

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

2025-05-15 Thread Volker Dusch
On Thu, May 15, 2025 at 12:10 AM Larry Garfield wrote: > Please include this in the RFC. Done > The concern is someone calling clone($foo, object: new Thingie()), which would complain that "object" is defined twice. Making the first argument named __object sidesteps that issue > If someone then

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

2025-05-15 Thread Andreas Hennings
On Thu, 15 May 2025 at 13:56, Stephen Reay wrote: > > > > > > On 15 May 2025, at 16:44, Andreas Hennings wrote: > > > > On Thu, 15 May 2025 at 08:24, Stephen Reay > > wrote: > > [..] > >> > >> > >> I may be missing something here.. > >> > >> So far the issues are "how do we deal with a paramet

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

2025-05-15 Thread Stephen Reay
> On 15 May 2025, at 16:44, Andreas Hennings wrote: > > On Thu, 15 May 2025 at 08:24, Stephen Reay wrote: > [..] >> >> >> I may be missing something here.. >> >> So far the issues are "how do we deal with a parameter for the actual >> object, vs new properties to apply", "should __clon

[PHP-DEV] Re: FrankenPHP moving under the PHP GitHub organization

2025-05-15 Thread Kévin Dunglas
Hi, Here is the announcement published by the PHP Foundation, Les-Tilleuls.coop, and the Caddy team: https://les-tilleuls.coop/en/blog/frankenphp-is-now-officially-supported-by-the-php-foundation Best,

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

2025-05-15 Thread Tim Düsterhus
Hi Am 2025-05-15 14:14, schrieb Rob Landers: For example, if you have a Money type, you'd want to be able to ensure it cannot be negative when updating via `with()`. This is super important for ensuring constraints are met during the clone. That's why the assignments during cloning work exact

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

2025-05-15 Thread Larry Garfield
On Thu, May 15, 2025, at 8:53 AM, Tim Düsterhus wrote: > Hi > > Am 2025-05-15 00:04, schrieb Larry Garfield: >> Subtle point here. If the __clone() method touches a readonly >> property, does that make the property inaccessible to the new >> clone-with? > > Yes. Quoting from the RFC: > >> The cu

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

2025-05-15 Thread Larry Garfield
On Thu, May 15, 2025, at 1:22 AM, Stephen Reay wrote: > I may be missing something here.. > > So far the issues are "how do we deal with a parameter for the actual > object, vs new properties to apply", "should __clone be called before > or after the changes" and "this won't allow regular read

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

2025-05-15 Thread Tim Düsterhus
Hi Am 2025-05-15 00:04, schrieb Larry Garfield: Subtle point here. If the __clone() method touches a readonly property, does that make the property inaccessible to the new clone-with? Yes. Quoting from the RFC: The currently linked implementation “locks” a property if it modified within __

Re: [PHP-DEV] [Vote] Pipe operator

2025-05-15 Thread Larry Garfield
On Wed, May 14, 2025, at 10:36 PM, Theodore Brown wrote: > On Wed, May 14, 2025 at 09:08 Larry Garfield wrote: > >> On Tue, May 13, 2025, at 5:55 PM, Ilija Tovilo wrote: >>> On Tue, May 13, 2025 at 3:58 AM Larry Garfield >>> wrote: I hereby open the vote on the Pipe operator RFC: >

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

2025-05-15 Thread Rob Landers
On Thu, May 15, 2025, at 13:56, Stephen Reay wrote: > > > > > On 15 May 2025, at 16:44, Andreas Hennings wrote: > > > > On Thu, 15 May 2025 at 08:24, Stephen Reay > > wrote: > > [..] > >> > >> > >> I may be missing something here.. > >> > >> So far the issues are "how do we deal with a p

Re: [PHP-DEV] Module or Class Visibility, Season 2

2025-05-15 Thread Rob Landers
On Thu, May 15, 2025, at 10:35, Rob Landers wrote: > On Thu, May 15, 2025, at 10:11, Rowan Tommins [IMSoP] wrote: >> >> >> On 14 May 2025 22:27:32 BST, Rob Landers wrote: >> > >> >As written, that simply isn't possible in PHP because there is only one >> >class allowed with a given name. Name

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

2025-05-15 Thread Andreas Hennings
On Thu, 15 May 2025 at 08:24, Stephen Reay wrote: [..] > > > I may be missing something here.. > > So far the issues are "how do we deal with a parameter for the actual object, > vs new properties to apply", "should __clone be called before or after the > changes" and "this won't allow regular

Re: [PHP-DEV] Module or Class Visibility, Season 2

2025-05-15 Thread Rob Landers
On Thu, May 15, 2025, at 10:11, Rowan Tommins [IMSoP] wrote: > > > On 14 May 2025 22:27:32 BST, Rob Landers wrote: > > > >As written, that simply isn't possible in PHP because there is only one > >class allowed with a given name. Names of classes are global. I don't think > >this has to be the

Re: [PHP-DEV] Module or Class Visibility, Season 2

2025-05-15 Thread Rowan Tommins [IMSoP]
On 14 May 2025 22:27:32 BST, Rob Landers wrote: > >As written, that simply isn't possible in PHP because there is only one class >allowed with a given name. Names of classes are global. I don't think this has >to be the case, though. Different languages take different approaches to this. >Fo