Possible Duplicate:
Best practices for static constructors
I want to create an object similar to the way jQuery is set up, that means have a main function and utility functions. I was thinking of doing something like this:
class main {
function __construct() {
echo 'this is the main usage of the object';
}
static function helper() {
echo 'this is a helper function';
}
}
So using the helper is pretty straightforward: main::helper();
but in order to use the main function itself I need to use the new
keyword everytime: new main()
. Is there any way to make it so that I can call the main function without using the new
keyword?