Re: [PHP-DEV] New RFC draft "static class constructor"

2015-04-14 Thread Dan Ackroyd
On 14 April 2015 at 17:39, Johannes Ott wrote: > Am 14.04.2015 um 16:33 schrieb Dan Ackroyd: > >> Here is some feedback then: >> Johannes Ott wrote: > But in the new draft (v0.4) I'm preparing at the moment I'll try to > formulate the trigger "first call" more common by comparing it to the > same

Re: [PHP-DEV] New RFC draft "static class constructor"

2015-04-14 Thread Johannes Ott
Am 14.04.2015 um 16:33 schrieb Dan Ackroyd: > Here is some feedback then: > > From the RFC: >> - Trigger for “magic” method call: First call to class, either first call to >> __construct(...) or first call to any public or protected static method or >> property of the class > > I don't think t

Re: [PHP-DEV] New RFC draft "static class constructor"

2015-04-14 Thread Jakub Kubíček
I would rather appreciate run-time class properties initialization. Best regards, Kubo2 2015-04-13 15:37 GMT+02:00 Johannes Ott : > 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 an

Re: [PHP-DEV] New RFC draft "static class constructor"

2015-04-14 Thread Dan Ackroyd
Hi Johannes, On 13 April 2015 at 13:37, Johannes Ott wrote: > 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. Here is some feedback then:

Re: [PHP-DEV] New RFC draft "static class constructor"

2015-04-14 Thread Johannes Schlüter
On Tue, 2015-04-14 at 11:49 +0200, Johannes Ott wrote: > Am 14.04.2015 um 00:16 schrieb Levi Morrison: > >> - IMO, the method should be called when the class is created, just after > >> every parent class and implemented interfaces are created. > > > > In general I think static class data and sta

Re: [PHP-DEV] New RFC draft "static class constructor"

2015-04-14 Thread Johannes Ott
Am 14.04.2015 um 00:16 schrieb Levi Morrison: >> - IMO, the method should be called when the class is created, just after >> every parent class and implemented interfaces are created. > > In general I think static class data and static class constructors are > a sign of poorly designed code, whic

Re: [PHP-DEV] New RFC draft "static class constructor"

2015-04-13 Thread Marcio Almada
Hi, 2015-04-13 10:37 GMT-03:00 Johannes Ott : > 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 prediscussi

Re: [PHP-DEV] New RFC draft "static class constructor"

2015-04-13 Thread Johannes Schlüter
On Mon, 2015-04-13 at 21:14 +0200, Johannes Ott wrote: > The obvious task is to initial the state of the class before usage as I > wrote inside my introduction of the RFC. That is one possible task users are going to try doing. Users are more creative. > I think there is no "random" behavior (not

Re: [PHP-DEV] New RFC draft "static class constructor"

2015-04-13 Thread Levi Morrison
On Mon, Apr 13, 2015 at 7:37 AM, Johannes Ott wrote: > 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. The static constructor cannot be call

Re: [PHP-DEV] New RFC draft "static class constructor"

2015-04-13 Thread Levi Morrison
> - IMO, the method should be called when the class is created, just after > every parent class and implemented interfaces are created. In general I think static class data and static class constructors are a sign of poorly designed code, which means I am against this feature. If it does make it

Re: [PHP-DEV] New RFC draft "static class constructor"

2015-04-13 Thread S.A.N
> Okay I will think about the alternative names, I somehow like > __classInit you proposed or __classConstruct I like simple: __init() -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] New RFC draft "static class constructor"

2015-04-13 Thread Johannes Ott
Am 13.04.2015 um 18:54 schrieb Johannes Schlüter: > On Mon, 2015-04-13 at 17:23 +0200, Johannes Schlüter wrote: >> Why am I saying it makes the language more complex? - Your proposal >> seems to miss mentioning when exactly the method is executed. what is > > Ah, I missed this > > Trigger

Re: [PHP-DEV] New RFC draft "static class constructor"

2015-04-13 Thread Johannes Schlüter
On Mon, 2015-04-13 at 17:23 +0200, Johannes Schlüter wrote: > Why am I saying it makes the language more complex? - Your proposal > seems to miss mentioning when exactly the method is executed. what is Ah, I missed this Trigger for “magic” method call: First call to class, either

Re: [PHP-DEV] New RFC draft "static class constructor"

2015-04-13 Thread Johannes Ott
Am 13.04.2015 um 18:02 schrieb François Laupretre: >> De : Johannes Ott [mailto:m...@deroetzi.de] >> 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

Re: [PHP-DEV] New RFC draft "static class constructor"

2015-04-13 Thread Johannes Ott
Am 13.04.2015 um 17:29 schrieb Benjamin Eberlei: > What would happen if you "call the parent constructor": > > class A extends B { >static public function __static() { > B::__static(); >} > } > Please have a closer look to the definition of the function: https://wiki.php.net/rfc

RE: [PHP-DEV] New RFC draft "static class constructor"

2015-04-13 Thread François Laupretre
> De : Johannes Ott [mailto:m...@deroetzi.de] > 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. Interesting. It also allows to respect PSR-1, which

Re: [PHP-DEV] New RFC draft "static class constructor"

2015-04-13 Thread Benjamin Eberlei
What would happen if you "call the parent constructor": class A extends B { static public function __static() { B::__static(); } } On Mon, Apr 13, 2015 at 5:23 PM, Johannes Schlüter wrote: > Hi, > > On Mon, 2015-04-13 at 15:37 +0200, Johannes Ott wrote: > > finally I managed to do

Re: [PHP-DEV] New RFC draft "static class constructor"

2015-04-13 Thread Johannes Schlüter
Hi, On Mon, 2015-04-13 at 15:37 +0200, Johannes Ott wrote: > 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. In my opinion this makes the language

[PHP-DEV] New RFC draft "static class constructor"

2015-04-13 Thread Johannes Ott
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 w