0

Hi Everyone!

The title pretty much explains it all! I have a variable which holds the site's root url, but to make it work online and offline on my xampp, I need to make some differences. When the end variable is output, there are two "intermsediary" ones I used to hold stuff, like the position of a slash in a string.

Once I have the end variable is it advisable to unset() the ones I don't use any more? Does this just use up more resources than it gains?

I will be looking around the web for php efficiency and resource usage, but if you could point me to your favorite articles/locations I'd be really thankful.

Thanks a lot!

3
Contributors
4
Replies
5
Views
8 Years
Discussion Span
Last Post by cwarn23
0

I can, but I'm interested in the general application, php "theory" in a sense, not the actual example.

0

Once I have the end variable is it advisable to unset() the ones I don't use any more? Does this just use up more resources than it gains?

Well if it is a variable that is a few kilobytes in size and there is plenty of time left to execute then for sure use unset() to save resources. Also if your making a script that takes minutes or hours or even days to execute then unset may need to be used all the time to prevent memory leaks. And I haven't confirmed this yet but there might be something wrong with the bcmath library which requires unset(). So their your basic uses but as for regular variables like numbers/integres you shouldn't need to unset.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.