Forum Moderators: coopster
I am creating a class that does a bunch stuff so I can display a page, with some headers and footers. I create this class once for each page loaded cos it has the stuff I need for headers etc. But..
When does the memory go away? Do I need to worry about this?
Do you mean, "when do the objects in memory go away?"
I believe when the object is destroyed, either with unset() or by simply going out of scope. You can check yours by using the functions listed on the Classes and Objects [us4.php.net] pages.
I have the following in my main page.
init_session();
$smarty = new Smarty_PageController;
$smarty->assign('name','WEB SITE);
I then have something like this..
<body>
<?php smarty->displayHeader()
smarty->displayBody()
smarty->displayFooter()?>
</body>
My question is when does smarty go away. Do I ** have ** to free it? And if so when? Where? If I do not explictly free it, when does it go away? Does it ever?