Greetings all,
Does anyone know how static objects work behind the scenes in PHP5?
More specifically, is there a benefit to declaring an object and its
methods as static vs the more traditional OO way of instantiating an
object and then calling methods through the -> operator?
For example if I have:
class Example {
public static function doSomething() {
/* doing something here */
}
}
and
class Example {
private __construct() {
/* constructing here */
}
public function doSomething() {
/* doing something here */
}
}
Is it more/less/equally efficient for the engine and parser to do:
$result = Example::doSomething();
or
$example = new Example();
$result = $example->doSomething();
Thanks in advance,
Mark
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php