• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Noobish question: Why unset a variable?

#6
[eluser]Michael Wales[/eluser]
Yes - variables will be automatically cleared from memory after script execution. It's much better to just let this happen - could you imagine how hideous your code would be if you unset() every variable at the end of the function - bleh...

Unsetting can be quite powerful though, I find myself usually using them when trying to remove unwanted values from an array (great when comparing two arrays).


Messages In This Thread
Noobish question: Why unset a variable? - by El Forum - 09-14-2008, 04:55 PM
Noobish question: Why unset a variable? - by El Forum - 09-14-2008, 05:16 PM
Noobish question: Why unset a variable? - by El Forum - 09-14-2008, 05:22 PM
Noobish question: Why unset a variable? - by El Forum - 09-14-2008, 10:00 PM
Noobish question: Why unset a variable? - by El Forum - 09-14-2008, 10:33 PM
Noobish question: Why unset a variable? - by El Forum - 09-15-2008, 04:24 AM
Noobish question: Why unset a variable? - by El Forum - 09-15-2008, 06:24 AM
Noobish question: Why unset a variable? - by El Forum - 09-15-2008, 06:25 AM
Noobish question: Why unset a variable? - by El Forum - 09-15-2008, 07:17 AM
Noobish question: Why unset a variable? - by El Forum - 09-15-2008, 04:32 PM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.