Gossamer Forum
Home : Products : Gossamer Links : PHP Front End :

Setting register_shutdown_function in Class

Quote Reply
Setting register_shutdown_function in Class
Hi

I have a working class with functions etc and would like to run a particular function in it after any function within the class is run.

So far... I can successfully place this call inside each individual function of the class and it will run DESTROY on exit of that particular function:

Code:
register_shutdown_function(array(&$this, 'DESTROY'));


But what I want to do is register this just once at the top of the script, just after the class name, so it applies to every function within the class - without having to include it in every function.

I have tried the above line but it gives errors, I have also tried this but it's giving error also:

Code:
register_shutdown_function('DESTROY');


Can anyone show me the correct way to do this to make it work?

Thanks.

Last edited by:

ryel01: Nov 12, 2005, 12:34 AM
Quote Reply
Re: [ryel01] Setting register_shutdown_function in Class In reply to
You need to put the call in every function you want to run it in, or...

upgrade to the latest php which has shutdown functions built in! Oh yeah!

r