Welcome Guest, Not a member yet? Register   Sign In
Noobish question: Why unset a variable?
#1

[eluser]codex[/eluser]
Everywhere in the CI corelibs I see variables being unset.

Code:
$this->routes = ( ! isset($route) OR ! is_array($route)) ? array() : $route;
        unset($route);

I may be answering my own question, but maybe someone could shed some extra light on the matter (couldn't find an explanation on the interwebs).

a) are vars being unset to free memory?
b) are vars being unset to prevent them from accidentally being used somewhere else?


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



Theme © iAndrew 2016 - Forum software by © MyBB