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
Subject Author Views Date
Thread Setting register_shutdown_function in Class ryel01 4626 Nov 12, 2005, 12:33 AM
Post Re: [ryel01] Setting register_shutdown_function in Class
ryel01 4434 Nov 24, 2005, 7:51 PM