Re: make new return a reference to existent object
| From: | Jason Barnett | Date: | Mon, 09 May 2005 15:45:17 +0000 |
| Subject: | Re: make new return a reference to existent object | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-16180@lists.php.net to get a copy of this message | ||
Leonardo Pedretti wrote:
I would like (for code cleanliness purposes) to make 'new' return a reference to an already created object under certain circumstances without using a factory, is it possible? Thanx"Under certain circumatances" ? ... If it's only under certain circumstances that you want a reference versus a copy versus an actual new object... well then why not use factory methods? Or perhaps you meant something like a "Singleton": http://phppatterns.com/index.php/article/articleview/6/1/1/