I had given up on someone actually going with one of my original ideas for
fixing the bug!
That is where I was leaning but I would take it a step further and add
constructors to all SPL classes even if the docs don't currently list one.

In regards to the implicit ctor and dtor. I don't thing it is actually any
more or less magic than what we have now.
Ask a Java programmer, they will likely say that having the implicit ctor
and dtor just makes sense and not having one is strange.

Although, in Java, all classes descend from Object so it is not quite the
same.

Side not: of course, an RFC does not mean that it will end up in a release.
It would still need to be voted on.



On Mon, May 16, 2011 at 5:25 PM, Etienne Kneuss <col...@php.net> wrote:

>
> The main problem with internal classes and ctors is that constructor
> code can be placed at object init instead of in the actual ctor method.
> It is actually safer to place it at object init, because then that code
> is always executed and thus the internal object is not in a half
> initialized state if the user overwrites the constructor and doesn't
> call the parent.
>
> I'd rather have ctors/dtors explicitely defined in SPL. If they are
> documented to exist, they should be explicitely defined. We can define
> such NOOP methods globally, so that it is easy for internal classes to add
> them.
>
> As far as implicitly ignore of the constructor, I believe we have enough
> magic regarding ctors/dtors in the engine as it is.
>
> Best,
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>

Reply via email to