freeing objects

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
Let's say that I've the following code (pseudo code cause this is a
question about how php gc works)

file class.php
class ClassX {
    //var $F_strDB;
    others vars here

   function DoWathEverDBJob(){
      connectToDB (using class variables as  $F_strDB)
      process results
      (# 1)
      return (true-false, not an array nor a result set)

} //class

file test.php
$classX = new ClassX;
$classX ->DoWathEverDBJob();
(# 2)


-Should I have to call mysql_free_result in (# 1)

-Should I have to "destroy" $classX in any way in (# 2)

I used to think that objects and queys would be destroyed
automatically, but i'm not sure right now...

regards - jm

Re: freeing objects

julian_m wrote:

Quoted text here. Click to load it

I should have written this way I guess:

Should I call mysql_free_result in (# 1)?

regards - jm

Site Timeline