PHP5 Class destructors
Posted: Thu Aug 12, 2004 2:42 pm
Are class destructors called when the user navigates away from a page requiring a class? For example:
since that "page" requires the class foo to work, will the instance of foo on the page (named bar) be "destructed" when the user navigates away from the page? When the php code is parsed? When?
Code: Select all
class foo {
function __construct() {
// do important stuff
}
function __destruct() {
// do other important stuff
}
// other functions
}Code: Select all
<?
require_once("foo.php");
bar = new foo;
?>
<!-- HTML goes here using powers of foo -->