can I unset a class?

Discussion in 'PHP' started by lanmonkey, Apr 13, 2008.

  1. #1
    if I initiate a class and set a load of variables in it can I get rid of it all simpy by by using the following:

    unset($my_class);

    ???

    thanks
     
    lanmonkey, Apr 13, 2008 IP
  2. stoli

    stoli Peon

    Messages:
    69
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    0
    #2
    If you instantiate a class...
    $my_object = new myClass();

    ...then you can destroy the object you created, along with all of its properties using unset:
    unset($my_object);
     
    stoli, Apr 13, 2008 IP
  3. lanmonkey

    lanmonkey Active Member

    Messages:
    549
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    60
    #3
    thanks dude, thats the answer I was looking for, just couldn't find it on google
     
    lanmonkey, Apr 13, 2008 IP