Christoph Boget schrieb:
Apart from making the constructor
private, is there any way I can ensure that there is ever only one
instance of an object?
you could use the magic method __clone.
For example:
public function __clone() { trigger_error('The singleton pattern avoids
cloning this instance', E_USER_ERROR); }
--
Viele Gruessee
Hi,
Dominik Strauss - www.n3or.de
Webentwicklung, PHP und Linux
Mobil: 0178 4940605
Internet: www.n3or.de
E-Mail: info@xxxxxxx
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php