class functions where the function name == class name
| From: | Glenn Yonemitsu | Date: | Tue, 13 Jan 2004 07:36:18 +0000 |
| Subject: | class functions where the function name == class name | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-174413@lists.php.net to get a copy of this message | ||
Hey there guys I just started trying out with writing classes. I've been looking at a lot of PEAR class files and noticed this:
class classname {
function classname() {
}
}
I know that "$object = new classname;" will automatically run $object->classname();. But is it neccessary for every class to have this function? I read all these scripts and they all have them. I made one simple database class but it failed horribly, and I'm curious to if the initiated functions have anything to do with them.
Thanks.
Glenn