Re: New RFC draft "static class constructor"

From: Date: Tue, 14 Apr 2015 00:39:02 +0000
Subject: Re: New RFC draft "static class constructor"
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-85795@lists.php.net to get a copy of this message
Hi, 2015-04-13 10:37 GMT-03:00 Johannes Ott <mail@deroetzi.de>: > Hi, > > finally I managed to do my first RFC draft. > > https://wiki.php.net/rfc/static_class_constructor > > I hope I have done everything correct so far and I'm looking forward to > your feedback on it. > > As I already mentioned in the prediscussion thread here: > > For being my first change to the PHP core, I would be very happy, if > someone of the "old stager" would help me with the implementation of > this RFC if it is accepted. > > Regards > > -- > DerOetzi > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > I know this is still a draft, but conceptually I don't like this feature. I always avoid static state on classes as much as possible and I think this should be avoided. But this is my personal opinion. Some suggestions: In case the RFC passes, I'd prefer to have a static{ ... } block instead of yet another static __ method. The reason is that this kind of construct is already known on other languages as static{...} and that feels more organized IMMO. In case you decide to proceed with the magic method approach, I'd prefer the more verbose __staticConstruct name because it seems clearer. Thanks, Márcio

« previous php.internals (#85795) next »