03-19-2008, 03:27 PM
|
#3 (permalink)
|
|
The Contributor
Join Date: Nov 2007
Location: California
Posts: 82
Thanks: 0
|
in my experience, using a static method like in your first example is a lot easier and faster to type.
Usually I use static methods for carrying around instances of objects I will want. For example:
PHP Code:
$db = Core::DB();
Returns my current instance of the database object.
I also use them for a quick authentication check:
PHP Code:
Auth::checkUser($_SESSION['Vars']['go']['Here']);
I just find that it takes less time to type one line, and why should I create a whole new instance of an object just to run one method ?
|
|
|
|