|
Posted by Michael Fesser on 07/25/07 07:22
..oO(Sanders Kaufman)
>Yeah - I got that that's HOW to do it. That's easy.
>I'm wondering WHY to do it.
Correctness? Stability? Style? Reliability?
>The best answer came from Jerry when he said it was for purely academic
>reasons - to keep tight with the OOP design principles.
>
>And while I do want to keep it as OOPish as is feasible, I don't want to
>introduce any extra functions that are not needed.
>
>Since PHP4 (and apparently 5, as well) doesn't make the constructor a
>private function
In PHP 5 you could make it private if you want.
>I don't yet see any reason to NOT use it as a
>reset-switch for my object; to return it to a pristine state.
A constructor is not a normal method and should not be seen as that.
Do you know for sure what PHP does internally when calling it? I don't.
"Abusing" it in the way that you do is not only _really_ bad style, but
might also cause problems for simple technical reasons.
>I did have a mild concern that it could result in something called a
>Zombie process, or that resources would be locked that don't need to be,
Why are you always referring to such zombie processes? Forget that.
That's not an issue here (and shouldn't be an issue with PHP at all).
Micha
Navigation:
[Reply to this message]
|