Automatic destructor in PHP4

<?php
class demoClass{

function demoClass(){
//destructor
register_shutdown_function(array(&$this, ‘__destruct’));

//constructor
$argcv = func_get_args();
call_user_func_array(array(&$this, ‘__construct’), $argcv);
}

function __construct(){
//your code for constructor goes here
}

function __destruct(){
//your code for destructor goes here
}

}

//Hope this method help you out with your problems.

//Hope this helps you,

//Sachin (samsami2u@gmail.com)
?>

Advertisements

3 thoughts on “Automatic destructor in PHP4

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s