Re: stdClass
| From: | Michael Walter | Date: | Fri, 27 Feb 2004 17:40:18 +0000 |
| Subject: | Re: stdClass | ||
| References: | 1 2 3 4 5 6 7 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-8236@lists.php.net to get a copy of this message | ||
Hartmut Holzgraefe wrote:
Jakes wrote:Cheers, MichaelOh, yes and special methods that you mentioned would come in handy too but from a object perspective. Maybe explicitly calling some sort finalize() method to clean un-referenced objects would also be handy.finalize() is one of the worst concepts of JAVA that i can think of: a somehow-destructor called at a non-forseeable time in the future (whenever the garbage collector thread tinks its about time to reclaim the only resource it is able to monitor: memory) there are even recommedations not to use it at all ... Indeed. UNWIND-PROTECT a.k.a. try { .. } finally { .. } in Java or using () { .. } in C# are usually a much better choice, I think. Similar problems apply to PHP __destructors, too, anyway (mainly the non-derminism of cleanup), probably those should be used with similar care ;-)