2013/9/27 Matthieu Napoli <matth...@mnapoli.fr> > Le 27/09/2013 09:17, Gordon Oheim a écrit : > > >> Independent but related to >> >> - >> https://wiki.php.net/rfc/**constructor-promotion<https://wiki.php.net/rfc/constructor-promotion> >> >> I wrote an RFC about porting Dart-like Automatic Property Initialization >> to PHP. Nikic was so generous to provide an initial PoC for it (since I >> don't do C): >> >> - >> https://wiki.php.net/rfc/**automatic_property_**initialization<https://wiki.php.net/rfc/automatic_property_initialization> >> - >> https://github.com/php/php-**src/pull/474<https://github.com/php/php-src/pull/474> >> > > I really like the proposal. > > I just wonder about how it could mix/conflict with the named parameters > proposal? Given what you said about Reflection ($this->foo is treated like > $foo), then I guess it's not a problem then. > > However maybe the RFC should reflect that you can't use: > > public function __construct($this->foo, $foo) { … } > > Also, at first glance I didn't find the "methodless constructor" very > useful (since it's only saving "{}"), but actually the possibility to use > this feature in setters too looks very good, it would avoid a lot of > boilerplate code.
Actually I would prefer to get rid of getters/setters completely and finally get _real_ accessor methods like in https://wiki.php.net/rfc/propertygetsetsyntax-v1.2 The ability to shorten the setters is interesting, but it makes them look "asymetric" to their corresponding getter (which still requires a body/code) and anyway: It just patches the symptom, that they are required at all. > > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > -- github.com/KingCrunch