Re: Singleton Pattern?
| From: | Chuck Hagenbuch | Date: | Thu, 18 Mar 2004 22:42:35 +0000 |
| Subject: | Re: Singleton Pattern? | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-26569@lists.php.net to get a copy of this message | ||
Quoting Paul M Jones <pmjones@ciaweb.net>:
This line is what's killing you. Lose the &, and it'll work. The reason is something to do with references and static variables that I've suppressed. -chuck -- "Regard my poor demoralized mule!" - Juan Valdezfunction &singleton() { static $obj;if (! isset($obj)) { echo "create "; $obj =& new test();