Hartmut Holzgraefe wrote:
Jakes wrote:
Oh, 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 ;-)
Cheers,
Michael
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php