This discussion is opened in the dedicated thread. I used my proposal as an example to illustrate my point of view, not to pollute this thread.
2012/10/16 Jazzer Dane <tbprogram...@gmail.com> > I prefer the current syntax to your proposal because: > > 1) It is not at all obvious which side is which. Example: > *protected:private > * Is protected* *for get? Or set? The average PHP developer will have > no idea. In fact, they likely won't know that they even correlate to get > and set. > > 2) There is no such syntax already in PHP. (And on a more personal note, > I don't think I've ever seen that syntax in any other language that I've > worked in before. Which means it's even *more-so* out of people's comfort > zones.) > > The current read/write syntax works, and none of the discussion I've read > thus far would sway me towards any other option. > > That being said, I wouldn't contest to hearing - in more detail - your > reasoning behind why we should use it instead of the current syntax. > > > On Tue, Oct 16, 2012 at 12:39 AM, Amaury Bouchard <ama...@amaury.net>wrote: > >> 2012/10/15 Clint Priest <cpri...@zerocue.com> >> >> > Also, your "should be valid" statement implies that you feel properties >> > and accessors are the same and they are not, internally. When a class >> > attempts to implement an interface a "function check" is done and since >> > there is no __getXX() function defined it would fail to implementation >> > check against an interface. >> > >> > I cannot stress enough that properties != accessors in any way except >> the >> > syntax in which they are used ($o->xyz) or ($o->xyz = 1), that is their >> > *only* similarity. >> >> >> I disagree. That's why I said this is a matter of choice. A philosophical >> choice. >> I don't see properties and accessors like different things which are >> accidentally written the same. Accessors are a layer upon properties. It's >> a magical layer, trying to mimic accessors. >> It's a bit like aspect-oriented programming: you can add layer but the >> core >> is still the same (from a developper point of view, not from the PHP >> interpreter point of view). >> >> >> See another argument: My proposal for read/write accessibility definition. >> When I suggested to allow this syntax: "public:private $abc;" >> some people objected that it's the same than "public $abc { get; private >> set; }" >> >> So, if I understand what you said, for you it's deeply different and >> comparing them is like comparing apples and oranges. I disagree. I still >> think my syntax is better (and could be implemented with better >> performance), but it's normal to compare them, because they (can) offer >> pretty much the same functionnalities. >> > >