Re: [PHP-DEV] [RFC[ Property accessor hooks, take 2

2024-03-31 Thread Larry Garfield
On Wed, Feb 21, 2024, at 12:55 PM, Larry Garfield wrote: > Hello again, fine Internalians. > > After much on-again/off-again work, Ilija and I are back with a more > polished property access hooks/interface properties RFC. It’s 99% > unchanged from last summer; the PR is now essentially

Re: [PHP-DEV] [RFC[ Property accessor hooks, take 2

2024-03-26 Thread Larry Garfield
On Tue, Mar 26, 2024, at 8:18 PM, Jakob Givoni wrote: > Hi, thanks for the RFC and the effort put into trying to make it > palatable to skeptical minds! > > After reading most of the discussion in this thread I believe that the > RFC in its current form can work and that I will get used to it's

Re: [PHP-DEV] [RFC[ Property accessor hooks, take 2

2024-03-26 Thread Jakob Givoni
On Wed, Feb 21, 2024, 19:57 Larry Garfield wrote: > Hello again, fine Internalians. > > After much on-again/off-again work, Ilija and I are back with a more > polished property access hooks/interface properties RFC. It’s 99% > unchanged from last summer; the PR is now essentially complete and

Re: [PHP-DEV] [RFC[ Property accessor hooks, take 2

2024-03-21 Thread Robert Landers
On Thu, Mar 21, 2024 at 5:15 PM Larry Garfield wrote: > > On Thu, Mar 21, 2024, at 9:10 AM, Robert Landers wrote: > > Hello, > > > > I'm a bit confused on inheritance. In the following example of a > > proxy, do I need to be aware of a parent's hook and handle it > > specially? > > > > class Loud

Re: [PHP-DEV] [RFC[ Property accessor hooks, take 2

2024-03-21 Thread Larry Garfield
On Thu, Mar 21, 2024, at 9:10 AM, Robert Landers wrote: > Hello, > > I'm a bit confused on inheritance. In the following example of a > proxy, do I need to be aware of a parent's hook and handle it > specially? > > class Loud > { > public string $name { > get { > return

Re: [PHP-DEV] [RFC[ Property accessor hooks, take 2

2024-03-21 Thread Robert Landers
Hello, I'm a bit confused on inheritance. In the following example of a proxy, do I need to be aware of a parent's hook and handle it specially? class Loud { public string $name { get { return strtoupper($this->name); } } } class LoudProxy extends Loud {

Re: [PHP-DEV] [RFC[ Property accessor hooks, take 2

2024-03-19 Thread Larry Garfield
On Tue, Mar 19, 2024, at 11:16 AM, Derick Rethans wrote: > On Fri, 8 Mar 2024, Larry Garfield wrote: > >> Hi folks. Based on earlier discussions, we've made a number of >> changes to the RFC that should address some of the concerns people >> raised. We also had some very fruitful discussions

Re: [PHP-DEV] [RFC[ Property accessor hooks, take 2

2024-03-19 Thread Derick Rethans
On Fri, 8 Mar 2024, Larry Garfield wrote: > Hi folks. Based on earlier discussions, we've made a number of > changes to the RFC that should address some of the concerns people > raised. We also had some very fruitful discussions off-list with > several developers from the Foundation, which

Re: [PHP-DEV] [RFC[ Property accessor hooks, take 2

2024-03-18 Thread Larry Garfield
On Mon, Mar 18, 2024, at 9:13 AM, Lynn wrote: > In regards to arrays, what about additional operations next to get/set? > I doubt this solution will cover all the use-cases or perhaps even > over-complicate things, just throwing the idea out there. > > ```php > class Test { > private array

Re: [PHP-DEV] [RFC[ Property accessor hooks, take 2

2024-03-18 Thread Rowan Tommins [IMSoP]
On 18/03/2024 00:04, Ilija Tovilo wrote: I realize this is somewhat inconsistent, but I believe it is reasonable. If you want to expose the underlying property by-reference, you need to jump through some additional hoops. I disagree with this reasoning, because I foresee plenty of cases where

Re: [PHP-DEV] [RFC[ Property accessor hooks, take 2

2024-03-18 Thread Lynn
On Wed, Feb 21, 2024 at 7:58 PM Larry Garfield wrote: > Hello again, fine Internalians. > > After much on-again/off-again work, Ilija and I are back with a more > polished property access hooks/interface properties RFC. It’s 99% > unchanged from last summer; the PR is now essentially complete

Re: [PHP-DEV] [RFC[ Property accessor hooks, take 2

2024-03-17 Thread Ilija Tovilo
Hi Rowan On Sun, Mar 17, 2024 at 3:41 PM Rowan Tommins [IMSoP] wrote: > > The remaining difference I can see in the current RFC which seems to be > unnecessary is that combining with set is only allowed on virtual > properties. Although it may be "virtual" in the strict sense, any > hook must

Re: [PHP-DEV] [RFC[ Property accessor hooks, take 2

2024-03-17 Thread Rowan Tommins [IMSoP]
On 17/03/2024 00:01, Ilija Tovilo wrote: For clarity, you are asking for a way to make the "virtualness" of properties more explicit, correct? Either more explicit, or less important: the less often the user needs to know whether a property is virtual, the less it matters how easily they

Re: [PHP-DEV] [RFC[ Property accessor hooks, take 2

2024-03-16 Thread Ilija Tovilo
Hi Rowan On Sat, Mar 16, 2024 at 8:23 PM Rowan Tommins [IMSoP] wrote: > > I still think there will be a lot of users coming from other languages, or > from using __get and __set, who will look at virtual properties first. Making > things less surprising for those people seems worth some

Re: [PHP-DEV] [RFC[ Property accessor hooks, take 2

2024-03-16 Thread Rowan Tommins [IMSoP]
On 16/03/2024 17:51, Ilija Tovilo wrote: Properties can inherit both storage and hooks from their parent. Hopefully, that helps with the mental model. Of course, in reality it is a bit more complicated due to guards and references. That is a really helpful explanation, thanks; I hadn't

Re: [PHP-DEV] [RFC[ Property accessor hooks, take 2

2024-03-16 Thread Ilija Tovilo
Hi Rowan On Sat, Mar 16, 2024 at 9:32 AM Rowan Tommins [IMSoP] wrote: > > On 16 March 2024 00:19:57 GMT, Larry Garfield wrote: > > >Well, reading/writing from within a set/get hook is an obvious use case to > >support. We cannot do cached properties easily otherwise: > > > >public string

Re: [PHP-DEV] [RFC[ Property accessor hooks, take 2

2024-03-16 Thread Rowan Tommins [IMSoP]
On 16 March 2024 00:19:57 GMT, Larry Garfield wrote: >Well, reading/writing from within a set/get hook is an obvious use case to >support. We cannot do cached properties easily otherwise: > >public string $expensive { > get => $this->expensive ??= $this->compute(); > set { >if

Re: [PHP-DEV] [RFC[ Property accessor hooks, take 2

2024-03-15 Thread Larry Garfield
On Fri, Mar 15, 2024, at 11:25 PM, Rowan Tommins [IMSoP] wrote: > On 15 March 2024 17:11:29 GMT, Larry Garfield wrote: >>On Wed, Mar 13, 2024, at 10:26 PM, Rowan Tommins [IMSoP] wrote: >>> I think it would be more helpful to justify this design on its own >>> merits, particularly because it's a

Re: [PHP-DEV] [RFC[ Property accessor hooks, take 2

2024-03-15 Thread Rowan Tommins [IMSoP]
On 15 March 2024 17:11:29 GMT, Larry Garfield wrote: >On Wed, Mar 13, 2024, at 10:26 PM, Rowan Tommins [IMSoP] wrote: >> I think it would be more helpful to justify this design on its own >> merits, particularly because it's a significant difference from other >> languages (which either

Re: [PHP-DEV] [RFC[ Property accessor hooks, take 2

2024-03-15 Thread Larry Garfield
On Wed, Mar 13, 2024, at 10:26 PM, Rowan Tommins [IMSoP] wrote: > On 12/03/2024 22:43, Larry Garfield wrote: >> It's slightly different, yes. The point is that the special behavior of a >> hook is disabled if you are within the call stack of a hook, just like the >> special behavior of

Re: [PHP-DEV] [RFC[ Property accessor hooks, take 2

2024-03-13 Thread Rowan Tommins [IMSoP]
On 12/03/2024 22:43, Larry Garfield wrote: It's slightly different, yes. The point is that the special behavior of a hook is disabled if you are within the call stack of a hook, just like the special behavior of __get/__set is disabled if you are within the call stack of __get/__set. What

Re: [PHP-DEV] [RFC[ Property accessor hooks, take 2

2024-03-12 Thread Larry Garfield
On Tue, Mar 12, 2024, at 10:09 PM, Rowan Tommins [IMSoP] wrote: >> if a `get` hook for property `$foo` calls method `bar()`, then inside that >> method `$this->foo` will refer to the raw property, both read and write. If >> `bar()` is called from somewhere other than the hook, reading from >>

Re: [PHP-DEV] [RFC[ Property accessor hooks, take 2

2024-03-12 Thread Rowan Tommins [IMSoP]
On 08/03/2024 15:53, Larry Garfield wrote: Hi folks. Based on earlier discussions, we've made a number of changes to the RFC that should address some of the concerns people raised. We also had some very fruitful discussions off-list with several developers from the Foundation, which led to

Re: [PHP-DEV] [RFC[ Property accessor hooks, take 2

2024-03-12 Thread Larry Garfield
On Tue, Mar 12, 2024, at 4:53 PM, Alexandru Pătrănescu wrote: > On Tue, Mar 12, 2024 at 4:36 PM Larry Garfield wrote: >> On Tue, Mar 12, 2024, at 8:49 AM, Stephen Reay wrote: >> >> > Hi Larry >> > >> > Thanks again for both of your work on this, I'm really hopeful this >> > passes. >> > >> >

Re: [PHP-DEV] [RFC[ Property accessor hooks, take 2

2024-03-12 Thread Alexandru Pătrănescu
On Tue, Mar 12, 2024 at 4:36 PM Larry Garfield wrote: > On Tue, Mar 12, 2024, at 8:49 AM, Stephen Reay wrote: > > > Hi Larry > > > > Thanks again for both of your work on this, I'm really hopeful this > passes. > > > > Was there ever any further discussion/resolution/decision about the use > >

Re: [PHP-DEV] [RFC[ Property accessor hooks, take 2

2024-03-12 Thread Larry Garfield
On Tue, Mar 12, 2024, at 8:49 AM, Stephen Reay wrote: > Hi Larry > > Thanks again for both of your work on this, I'm really hopeful this passes. > > Was there ever any further discussion/resolution/decision about the use > an explicit `virtual` keyword, and the related flag for creation of a >

Re: [PHP-DEV] [RFC[ Property accessor hooks, take 2

2024-03-12 Thread Stephen Reay
> On 8 Mar 2024, at 22:53, Larry Garfield wrote: > > Hi folks. Based on earlier discussions, we've made a number of changes to > the RFC that should address some of the concerns people raised. We also had > some very fruitful discussions off-list with several developers from the >

Re: [PHP-DEV] [RFC[ Property accessor hooks, take 2

2024-03-11 Thread Larry Garfield
On Mon, Mar 11, 2024, at 4:13 PM, Bruce Weirdan wrote: > On Tue, Feb 27, 2024 at 6:22 PM Bruce Weirdan wrote: >> >> Hi Larry and others >> >> On Fri, Feb 23, 2024 at 12:57 AM Larry Garfield >> wrote: >> > >> > >> > I've added an FAQ section explaining why the Python/JS approach wouldn't >> >

Re: [PHP-DEV] [RFC[ Property accessor hooks, take 2

2024-03-11 Thread Larry Garfield
On Mon, Mar 11, 2024, at 4:58 PM, Michał Marcin Brzuchalski wrote: >> Hm, interesting. I'll have to check with Ilija on feasibility. My question >> is, how would it eliminate it? >> >> Suppose we hypothetically have a "ReflectionPropertyWithHooks" reflection >> object. It has those three

Re: [PHP-DEV] [RFC[ Property accessor hooks, take 2

2024-03-11 Thread Michał Marcin Brzuchalski
pon., 11 mar 2024 o 15:30 Larry Garfield napisał(a): > On Mon, Mar 11, 2024, at 8:35 AM, Michał Marcin Brzuchalski wrote: > > Hi Larry, > > > > pt., 8 mar 2024 o 16:55 Larry Garfield > napisał(a): > >> Hi folks. Based on earlier discussions, we've made a number of changes > to the RFC that

Re: [PHP-DEV] [RFC[ Property accessor hooks, take 2

2024-03-11 Thread Bruce Weirdan
On Tue, Feb 27, 2024 at 6:22 PM Bruce Weirdan wrote: > > Hi Larry and others > > On Fri, Feb 23, 2024 at 12:57 AM Larry Garfield > wrote: > > > > > > I've added an FAQ section explaining why the Python/JS approach wouldn't > > really work. To be clear, Ilija and I spent 100+ hours doing

Re: [PHP-DEV] [RFC[ Property accessor hooks, take 2

2024-03-11 Thread Larry Garfield
On Mon, Mar 11, 2024, at 8:35 AM, Michał Marcin Brzuchalski wrote: > Hi Larry, > > pt., 8 mar 2024 o 16:55 Larry Garfield napisał(a): >> Hi folks. Based on earlier discussions, we've made a number of changes to >> the RFC that should address some of the concerns people raised. We also had >>

Re: [PHP-DEV] [RFC[ Property accessor hooks, take 2

2024-03-11 Thread Michał Marcin Brzuchalski
Hi Larry, pt., 8 mar 2024 o 16:55 Larry Garfield napisał(a): > Hi folks. Based on earlier discussions, we've made a number of changes to > the RFC that should address some of the concerns people raised. We also > had some very fruitful discussions off-list with several developers from > the

Re: [PHP-DEV] [RFC[ Property accessor hooks, take 2

2024-03-08 Thread Larry Garfield
Hi folks. Based on earlier discussions, we've made a number of changes to the RFC that should address some of the concerns people raised. We also had some very fruitful discussions off-list with several developers from the Foundation, which led to what we feel are some solid improvements.

Re: [PHP-DEV] [RFC[ Property accessor hooks, take 2

2024-03-04 Thread Larry Garfield
On Mon, Mar 4, 2024, at 3:45 PM, Robert Landers wrote: > I would think that simply using return-to-set would be the simplest > solution, if you need to run something after it's set, you can use the > regular way of running code after a return: > > try { > return $value + 100; > } finally { >

Re: [PHP-DEV] [RFC[ Property accessor hooks, take 2

2024-03-04 Thread Gina P. Banyard
On Friday, 1 March 2024 at 06:28, Stephen Reay wrote: > For the third time: I'm well aware of how parameter types work everywhere > else, and that's why I'm asking why the same behaviour isn't being followed > here? > > - You've said you want to avoid boilerplate; and > - You've said you

Re: [PHP-DEV] [RFC[ Property accessor hooks, take 2

2024-03-04 Thread Rowan Tommins [IMSoP]
On 27/02/2024 23:17, Larry Garfield wrote: > > A little history here to help clarify how we ended up where we are: The > original RFC as we designed it modeled very closely on Swift, with 4 hooks. > Using get/set at all would create a virtual property and you were on your > own, while the

Re: [PHP-DEV] [RFC[ Property accessor hooks, take 2

2024-03-04 Thread Larry Garfield
On Fri, Mar 1, 2024, at 6:28 AM, Stephen Reay wrote: == Re the $value variable in set >> >> *snip* >> So what makes the most sense to me is to keep $value optional, but IF you specify an alternate name, you must also specify a type (which may be wider). So these are

Re: [PHP-DEV] [RFC[ Property accessor hooks, take 2

2024-03-04 Thread Robert Landers
On Mon, Mar 4, 2024 at 4:40 PM Stephen Reay wrote: > > > > > On 28 Feb 2024, at 06:17, Larry Garfield wrote: > > > > On Sun, Feb 25, 2024, at 10:16 PM, Rowan Tommins [IMSoP] wrote: > >> [Including my full previous reply, since the list and gmail currently > >> aren't being friends. Apologies

Re: [PHP-DEV] [RFC[ Property accessor hooks, take 2

2024-03-01 Thread Stephen Reay
> On 28 Feb 2024, at 21:25, Larry Garfield wrote: > > On Wed, Feb 28, 2024, at 7:49 AM, Stephen Reay wrote: > > *snip* > >>> == Re virtual properties: >>> >>> Ilija and I talked this through, and there's pros and cons to a `virtual` >>> keyword. Ilija also suggested a `backed` keyword,

Re: [PHP-DEV] [RFC[ Property accessor hooks, take 2

2024-02-28 Thread Gina P. Banyard
On Tuesday, 27 February 2024 at 23:17, Larry Garfield wrote: > I genuinely don't understand the pushback on $value. It's something you learn > once and never have to think about again. It's consistent. > > Ilija jokingly suggested making it always $value, unconditionally, and > allowing only

Re: [PHP-DEV] [RFC[ Property accessor hooks, take 2

2024-02-28 Thread Larry Garfield
On Wed, Feb 28, 2024, at 7:49 AM, Stephen Reay wrote: *snip* >> == Re virtual properties: >> >> Ilija and I talked this through, and there's pros and cons to a `virtual` >> keyword. Ilija also suggested a `backed` keyword, which forces a backed >> property to exist even if it's not used in

Re: [PHP-DEV] [RFC[ Property accessor hooks, take 2

2024-02-28 Thread Stephen Reay
> On 28 Feb 2024, at 06:17, Larry Garfield wrote: > > On Sun, Feb 25, 2024, at 10:16 PM, Rowan Tommins [IMSoP] wrote: >> [Including my full previous reply, since the list and gmail currently >> aren't being friends. Apologies that this leads to rather a lot of >> reading in one go...] > >

Re: [PHP-DEV] [RFC[ Property accessor hooks, take 2

2024-02-27 Thread Larry Garfield
On Tue, Feb 27, 2024, at 8:51 PM, Benjamin Außenhofer wrote: > thank you for this proposal. there are some points i'd like to make > into this discussion: > > * Thank you for the removal of $field, it was non-idomatic from a PHP POV. > > * I would prefer that the short syntax $foo => null; be

Re: [PHP-DEV] [RFC[ Property accessor hooks, take 2

2024-02-27 Thread Larry Garfield
On Sun, Feb 25, 2024, at 10:16 PM, Rowan Tommins [IMSoP] wrote: > [Including my full previous reply, since the list and gmail currently > aren't being friends. Apologies that this leads to rather a lot of > reading in one go...] Eh, I'd prefer a few big emails that come in slowly to lots of

Re: [PHP-DEV] [RFC[ Property accessor hooks, take 2

2024-02-27 Thread Alexandru Pătrănescu
On Wed, Feb 21, 2024, 20:58 Larry Garfield wrote: > Hello again, fine Internalians. > > After much on-again/off-again work, Ilija and I are back with a more > polished property access hooks/interface properties RFC. > I liked how the discussion and the RFC evolved so far and that we have less

Re: [PHP-DEV] [RFC[ Property accessor hooks, take 2

2024-02-27 Thread Benjamin Außenhofer
Hey, On Wed, Feb 21, 2024 at 7:58 PM Larry Garfield wrote: > Hello again, fine Internalians. > > After much on-again/off-again work, Ilija and I are back with a more > polished property access hooks/interface properties RFC. It’s 99% > unchanged from last summer; the PR is now essentially

Re: [PHP-DEV] [RFC[ Property accessor hooks, take 2

2024-02-27 Thread Rowan Tommins [IMSoP]
On 27/02/2024 17:49, Erick de Azevedo Lima wrote: > It sounds like most people are just really, really pissed off by an implicit variable I think that it could be good to follow the PHP way to mark the "magic" stuff, which is putting leading underscores on the magic stuff. I think that

Re: [PHP-DEV] [RFC[ Property accessor hooks, take 2

2024-02-27 Thread Rob Landers
On Tue, Feb 27, 2024, at 17:16, Larry Garfield wrote: > On Tue, Feb 27, 2024, at 10:01 AM, Frederik Bosch wrote: > > > Hi Rowan, > > > > Our discussion sums up the pros and cons. Whether yield is > > complicated/confusing or not, is maybe personal. The same applies to > > getting $this->prop

Re: [PHP-DEV] [RFC[ Property accessor hooks, take 2

2024-02-27 Thread Erick de Azevedo Lima
> It sounds like most people are just really, really pissed off by an implicit variable I think that it could be good to follow the PHP way to mark the "magic" stuff, which is putting leading underscores on the magic stuff. It's not pretty, but it's good because our eyes can detect the magic stuff

Re: [PHP-DEV] [RFC[ Property accessor hooks, take 2

2024-02-27 Thread Bruce Weirdan
Hi Larry and others On Fri, Feb 23, 2024 at 12:57 AM Larry Garfield wrote: > > > I've added an FAQ section explaining why the Python/JS approach wouldn't > really work. To be clear, Ilija and I spent 100+ hours doing research and > design before we started implementation (back in mid-late

Re: [PHP-DEV] [RFC[ Property accessor hooks, take 2

2024-02-27 Thread Larry Garfield
On Tue, Feb 27, 2024, at 10:01 AM, Frederik Bosch wrote: > Hi Rowan, > > Our discussion sums up the pros and cons. Whether yield is > complicated/confusing or not, is maybe personal. The same applies to > getting $this->prop resulting in different calls. Larry has removed > $field from the RFC

Re: [PHP-DEV] [RFC[ Property accessor hooks, take 2

2024-02-27 Thread Frederik Bosch
On 27-02-2024 10:49, Rowan Tommins [IMSoP] wrote: On 26 February 2024 23:11:16 GMT, Frederik Bosch wrote: >And what happens in the following situation, how are multiple get calls working together? > >public string $fullName { >    get => $this->first . ' ' . $this->last; // is this

Re: [PHP-DEV] [RFC[ Property accessor hooks, take 2

2024-02-27 Thread Rowan Tommins [IMSoP]
On 26 February 2024 23:11:16 GMT, Frederik Bosch wrote: >And what happens in the following situation, how are multiple get calls >working together? > >public string $fullName { >    get => $this->first . ' ' . $this->last; // is this accessing the backed >value, or is it accessing via get >   

Re: [PHP-DEV] [RFC[ Property accessor hooks, take 2

2024-02-26 Thread Rob Landers
On Tue, Feb 27, 2024, at 00:11, Frederik Bosch wrote: > Hi Rowan, > > On 26-02-2024 23:46, Rowan Tommins [IMSoP] wrote: >> On 26/02/2024 20:21, Frederik Bosch wrote: >>> I do note that $this->propName might suggest that the backing value is >>> accessible from other locations than only the

Re: [PHP-DEV] [RFC[ Property accessor hooks, take 2

2024-02-26 Thread Frederik Bosch
Hi Rowan, On 26-02-2024 23:46, Rowan Tommins [IMSoP] wrote: On 26/02/2024 20:21, Frederik Bosch wrote: I do note that $this->propName might suggest that the backing value is accessible from other locations than only the property's own get/set methods, because of $this usage. Yes, I

Re: [PHP-DEV] [RFC[ Property accessor hooks, take 2

2024-02-26 Thread Rowan Tommins [IMSoP]
On 26/02/2024 20:21, Frederik Bosch wrote: I do note that $this->propName might suggest that the backing value is accessible from other locations than only the property's own get/set methods, because of $this usage. Yes, I actually stumbled over that confusion when I was writing some of

Re: [PHP-DEV] [RFC[ Property accessor hooks, take 2

2024-02-26 Thread Larry Garfield
On Mon, Feb 26, 2024, at 7:39 PM, Rowan Tommins [IMSoP] wrote: > On 26/02/2024 19:02, Frederik Bosch wrote: >> >> That's how it always has been, no? So in your example, short code >> abbreviated form would not work. One has to write a block. >> >> public string$fullName { >>

Re: [PHP-DEV] [RFC[ Property accessor hooks, take 2

2024-02-26 Thread Frederik Bosch
Hi Rowan, Thanks for clearing up that the return value will be ignored. I understand better why that is (void = null). I do like the updated RFC better than the one with the $field variable to write to. My yield suggestion was an idea derived from that earlier $field write proposal, but I

Re: [PHP-DEV] [RFC[ Property accessor hooks, take 2

2024-02-26 Thread Rowan Tommins [IMSoP]
On 26/02/2024 19:02, Frederik Bosch wrote: That's how it always has been, no? So in your example, short code abbreviated form would not work. One has to write a block. public string$fullName { set=> [$this->first, $this->last] = explode ('

Re: [PHP-DEV] [RFC[ Property accessor hooks, take 2

2024-02-26 Thread Frederik Bosch
On 23-02-2024 16:58, Larry Garfield wrote: On Fri, Feb 23, 2024, at 8:33 AM, Stephen Reay wrote: On 23 Feb 2024, at 06:56, Larry Garfield wrote: Hi Larry, It's good to see this idea still progressing. I have to agree with the other comment(s) that the implicit `$field`/`$value` variables

Re: [PHP-DEV] [RFC[ Property accessor hooks, take 2

2024-02-26 Thread Rowan Tommins [IMSoP]
On Thu, 22 Feb 2024, at 23:56, Larry Garfield wrote: > However, I just had a long discussion with Ilija and there is one > possibility we could consider: Use the return value only on the > shorthand (arrow-function-like) syntax. > > So you could do either of these, which would be equivalent: > >

Re: [PHP-DEV] [RFC[ Property accessor hooks, take 2

2024-02-25 Thread Rowan Tommins [IMSoP]
[Including my full previous reply, since the list and gmail currently aren't being friends. Apologies that this leads to rather a lot of reading in one go...] On 21/02/2024 18:55, Larry Garfield wrote: Hello again, fine Internalians. After much on-again/off-again work, Ilija and I are back

Re: [PHP-DEV] [RFC[ Property accessor hooks, take 2

2024-02-23 Thread Larry Garfield
On Fri, Feb 23, 2024, at 4:50 PM, Stephen Reay wrote: >> On 23 Feb 2024, at 22:58, Larry Garfield wrote: >> >> On Fri, Feb 23, 2024, at 8:33 AM, Stephen Reay wrote: On 23 Feb 2024, at 06:56, Larry Garfield wrote: >> >>> Hi Larry, >>> >>> It's good to see this idea still progressing. >>>

Re: [PHP-DEV] [RFC[ Property accessor hooks, take 2

2024-02-23 Thread Larry Garfield
On Fri, Feb 23, 2024, at 5:35 PM, Marc Bennewitz wrote: > Hi Larry, > > first of all thank you very much for this amazing work you two have been > done :+1:. > I'm also feeling that introducing magic variables isn't the best design > choice. > I read your section about "Why do set hooks not

Re: [PHP-DEV] [RFC[ Property accessor hooks, take 2

2024-02-23 Thread Marc Bennewitz
Hi Larry, first of all thank you very much for this amazing work you two have been done :+1:. On 23.02.24 00:56, Larry Garfield wrote: On Wed, Feb 21, 2024, at 11:02 PM, Matthew Weier O'Phinney wrote: On Wed, Feb 21, 2024 at 12:57 PM Larry Garfield wrote: After much on-again/off-again

Re: [PHP-DEV] [RFC[ Property accessor hooks, take 2

2024-02-23 Thread Stephen Reay
 > On 23 Feb 2024, at 22:58, Larry Garfield wrote: > > On Fri, Feb 23, 2024, at 8:33 AM, Stephen Reay wrote: >>> On 23 Feb 2024, at 06:56, Larry Garfield wrote: > >> Hi Larry, >> It's good to see this idea still progressing. >> I have to agree with the other comment(s) that the implicit >>

Re: [PHP-DEV] [RFC[ Property accessor hooks, take 2

2024-02-23 Thread Larry Garfield
On Fri, Feb 23, 2024, at 8:33 AM, Stephen Reay wrote: >> On 23 Feb 2024, at 06:56, Larry Garfield wrote: > Hi Larry, > > It's good to see this idea still progressing. > > > I have to agree with the other comment(s) that the implicit > `$field`/`$value` variables seem odd to me. I understand the

Re: [PHP-DEV] [RFC[ Property accessor hooks, take 2

2024-02-23 Thread Stephen Reay
> On 23 Feb 2024, at 06:56, Larry Garfield wrote: > > On Wed, Feb 21, 2024, at 11:02 PM, Matthew Weier O'Phinney wrote: >> On Wed, Feb 21, 2024 at 12:57 PM Larry Garfield >> wrote: >>> After much on-again/off-again work, Ilija and I are back with a more >>> polished property access

Re: [PHP-DEV] [RFC[ Property accessor hooks, take 2

2024-02-22 Thread Larry Garfield
On Wed, Feb 21, 2024, at 11:02 PM, Matthew Weier O'Phinney wrote: > On Wed, Feb 21, 2024 at 12:57 PM Larry Garfield > wrote: >> After much on-again/off-again work, Ilija and I are back with a more >> polished property access hooks/interface properties RFC. It’s 99% unchanged >> from last

Re: [PHP-DEV] [RFC[ Property accessor hooks, take 2

2024-02-22 Thread Tim Düsterhus
Hi 1. I believe there is an error in the "Final Hooks" section: > // But this is NOT allowed, because beforeSet is final in the parent. I believe it should be s/beforeSet/set/. 2. In the same section this sentence is probably grammatically incorrect. > Declaring hooks final on a property

Re: [PHP-DEV] [RFC[ Property accessor hooks, take 2

2024-02-22 Thread Tim Düsterhus
Hi On 2/22/24 00:02, Matthew Weier O'Phinney wrote: Once again in reading the proposal, the first thing I'm struck by are the magic "$field" and "$value" variables inside accessors. The first time they are used, they're used without explanation, and they're jarring. […] Second: you don't have

Re: [PHP-DEV] [RFC[ Property accessor hooks, take 2

2024-02-22 Thread Deleu
On Thu, Feb 22, 2024 at 8:25 AM tag Knife wrote: > A few things i was interested to get the idea around. > Was it thought about for the set{} for it to return the value to set the > property to > instead implicitly setting its own field? > > eg > > ``` > public string $name { > set { >

Re: [PHP-DEV] [RFC[ Property accessor hooks, take 2

2024-02-22 Thread tag Knife
On Wed, 21 Feb 2024 at 18:56, Larry Garfield wrote: > Hello again, fine Internalians. > > After much on-again/off-again work, Ilija and I are back with a more > polished property access hooks/interface properties RFC. It’s 99% > unchanged from last summer; the PR is now essentially complete and

Re: [PHP-DEV] [RFC[ Property accessor hooks, take 2

2024-02-22 Thread Robert Landers
On Wed, Feb 21, 2024 at 7:59 PM Larry Garfield wrote: > > Hello again, fine Internalians. > > After much on-again/off-again work, Ilija and I are back with a more polished > property access hooks/interface properties RFC. It’s 99% unchanged from last > summer; the PR is now essentially

Re: [PHP-DEV] [RFC[ Property accessor hooks, take 2

2024-02-21 Thread Robert Landers
On Thu, Feb 22, 2024 at 1:03 AM Pierre wrote: > > Le 21/02/2024 à 19:55, Larry Garfield a écrit : > > Hello again, fine Internalians. > > > > After much on-again/off-again work, Ilija and I are back with a more > > polished property access hooks/interface properties RFC. It’s 99% > > unchanged

Re: [PHP-DEV] [RFC[ Property accessor hooks, take 2

2024-02-21 Thread Deleu
On Wed, Feb 21, 2024 at 3:58 PM Larry Garfield wrote: > Hello again, fine Internalians. > > After much on-again/off-again work, Ilija and I are back with a more > polished property access hooks/interface properties RFC. It’s 99% > unchanged from last summer; the PR is now essentially complete

Re: [PHP-DEV] [RFC[ Property accessor hooks, take 2

2024-02-21 Thread Matthew Weier O'Phinney
On Wed, Feb 21, 2024 at 12:57 PM Larry Garfield wrote: > After much on-again/off-again work, Ilija and I are back with a more > polished property access hooks/interface properties RFC. It’s 99% > unchanged from last summer; the PR is now essentially complete and more > robust, and we were able

Re: [PHP-DEV] [RFC[ Property accessor hooks, take 2

2024-02-21 Thread Pierre
Le 21/02/2024 à 19:55, Larry Garfield a écrit : Hello again, fine Internalians. After much on-again/off-again work, Ilija and I are back with a more polished property access hooks/interface properties RFC. It’s 99% unchanged from last summer; the PR is now essentially complete and more

Re: [PHP-DEV] [RFC[ Property accessor hooks, take 2

2024-02-21 Thread Erick de Azevedo Lima
It's really nice! >>> We are willing to do so if the consensus is that it would be beneficial, but want to ask before putting in the effort. I really think that it's not necessary, as the it still hooks into the default behavior of the properties. Even though I don't have voting privileges, I'm