Posted by Sanders Kaufman on 07/25/07 20:22
Iván Sánchez Ortega wrote:
> Sanders Kaufman wrote:
>
>> Since PHP4 (and apparently 5, as well) doesn't make the constructor a
>> private function, 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.
>
> Declaring the constructor as private prevents the programmer from
> instantiating the class outside the class scope. Go read the Singleton
> pattern.
There is no way to declare a constructor as private in PHP4.
Navigation:
[Reply to this message]
|