Re: class functions where the function name == class name
| From: | Richard Davey | Date: | Tue, 13 Jan 2004 09:34:53 +0000 |
| Subject: | Re: class functions where the function name == class name | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-174414@lists.php.net to get a copy of this message | ||
Hello Glenn,
Tuesday, January 13, 2004, 7:36:18 AM, you wrote:
GY> I know that "$object = new classname;" will automatically run
$object->>classname();. But is it neccessary for every class to have this
GY> function? I read all these scripts and they all have them. I made one
GY> simple database class but it failed horribly, and I'm curious to if the
GY> initiated functions have anything to do with them.
It's called the constructor and no, you don't always have to have one.
--
Best regards,
Richard mailto:rich@launchcode.co.uk