Posted by Janwillem Borleffs on 08/06/05 13:07
Markus Wallner wrote:
> Is there a way to initialize a static class similar to ___construct()
> in php ?
>
When the constructor of the class is private, you could use a wrapper which
extends it:
class Foo {
private function __construct() {}
public function printMessage($msg) {
print $msg;
}
}
class FooBar extends Foo {
public function __construct() {}
}
$foobar = new FooBar;
$foobar->printMessage('hello');
JW
[Back to original message]
|