Bug #827: request on object constructors

From: Date: Tue, 06 Oct 1998 21:27:21 +0000
Subject: Bug #827: request on object constructors
Groups: php.dev 
Request: Send a blank email to php-dev+get-1712@lists.php.net to get a copy of this message
From: be@SHonline.DE Operating system: any PHP version: 3.0.5 PHP Bug Type: Feature/Change Request Bug description: request on object constructors The constructor method of a class should be changed from the classes name to "init" or whatever static name - or additional support for this should be given for backward compatibility. W H Y ? ? The current solution makes it impossible to inherit from a class with constructor method without rewriting the constructor method. Example: class origin { function origin() { # i will initiate all the neccessary things ; } class inherit extends origin { ; } $q = new inherit; Now nothing is done because inheritance loses the destructor. In case of a library which lays in the background this is a bad thing. Documentaion provides some slots of a class to be an api to the user of that library class. Inheritance is the method of choice to configure such a class. Its a bad idea(tm) to force the user of a library to rewrite or wrap the internals of that library. That makes the idea of a library obsolete. Boris -- PHP Development Mailing List http://www.php.net/ To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net For help: php-dev-help@lists.php.net

« previous php.dev (#1712) next »