|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[1998-10-07 15:46 UTC] zeev
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Nov 09 04:00:01 2025 UTC |
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