2012/10/13 Clint Priest <cpri...@zerocue.com> > Interfaces are used to define what methods must be present, properties > are not allowed.**** > > ** ** > > Yes, so no one should be correct, right?**** > > I mean, yes the first declaration implies some code; but for the > interface, it's still a property definition.**** > > ** ** > > You’re mixing concepts here, it’s an accessor definition, not a property > definition. property != accessor, an accessor just happens to look and act > like a property (which is the point of accessors). >
Interfaces define methods, not properties. Fine. But is an accessor (as defined in the RFC) a method? Or should we consider that an accessor definition is valid inside an interface? I would say no, because it will be used as a property: outside of the object that implements the accessor, nobody know if it's an attribute or an accessor function. It's the whole point of the RFC (apart from the asymetric visibility, but you know my point of view). So, for me, this code should be incorrect: interface Fooable { public $abc { get; set; } } Because if an object implements the interface: class Fooer implements Fooable { public $abc { get { /* what you want */ } set { /* what you want too */ } } } How this code will be used? Like that: $foo = new Fooer(); $foo->abc = 3; print($foo->abc); Everybody will agree with me that $abc is used like a property, not as a method. So the language should enforce that. There is a real issue here; this is not a fad from me.