GIDForums  

Go Back   GIDForums > Computer Programming Forums > MySQL / PHP Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 08-Jan-2003, 15:55
JdS's Avatar
JdS JdS is offline
Senior Member
 
Join Date: Aug 2001
Location: KUL, Malaysia
Posts: 3,371
JdS will become famous soon enough

Is it important to UNSET($vars)?


I was just wondering...

Is it important to unset() variables and/or arrays in PHP (as soon as I am done with them in a script)?

Recently, I've got into this habit (I always thought it would be better for me to do that) but can't find a decent article or discussion on it...

Any comments or thoughts, appreciated.
  #2  
Old 10-Jan-2003, 06:25
Elmseeker's Avatar
Elmseeker Elmseeker is offline
Awaiting Email Confirmation
 
Join Date: Jan 2003
Posts: 87
Elmseeker is on a distinguished road
It isn't important as php automatically flushes all of that stuff when the script finishes anyways. The only time you want to unset them if you are not going to use them anymore and don't it to be possible for them to be used later in the script.
  #3  
Old 10-Jan-2003, 06:36
JdS's Avatar
JdS JdS is offline
Senior Member
 
Join Date: Aug 2001
Location: KUL, Malaysia
Posts: 3,371
JdS will become famous soon enough
Yes, this is what I read too but I had to read it again when I noticed they were talking about resource variables and not normal ones.

From php manual:

Quote:
When this is the case, all resources that were in use for this resource are made free by the garbage collector. For this reason, it is rarely ever necessary to free the memory manually by using some free_result function.
 
 

Recent GIDBlogWelcome to Baghdad by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
need help Important mbuali Computer Hardware Forum 3 01-Sep-2003 05:46
topsites appearing on all the important search engines bar altavista jrobbio GIDTopsites™ 10 12-Jan-2003 05:54

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 01:04.


vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.