NYCPHP Meetup

NYPHP.org

[nycphp-talk] Rely on destructor to be called?!

Jakob Buchgraber jakob.buchgraber at googlemail.com
Thu Jun 28 15:11:44 EDT 2007


Hey!

I am writing a logging class which writes all the data that are to be 
logged in a buffer and when the destructor is called the buffer is 
cleared and written to some data storage.

So I wanted to know whether I can rely on the destructor to be called.

In my tests I just figured out that it won't get called if the script 
ends with a fatal error or something comparable. Otherwise it's always 
invoked.

So just to ensure that I haven't forgotten something? Is there any other 
situation where it's not invoked?

Cheers,
Jay

-- 
Sun Certified Programmer for the Java 2 Platform, Standard Edition 5.0



More information about the talk mailing list