Page is a not externally linkable
- Code, Content, and Presentation
-- PHP Server Side Scripting
---- Calling a session variable multiple times on a page


penders - 8:56 am on Jul 29, 2010 (gmt 0)


Also, declaring the same variable twice is going to cause the script to consume more memory.


Or, assigning one variable to another. Actually, this does not consume as much memory as you might think, if any (although I suspect there will need to be an additional entry in the symbol table?). PHP implements copy-on-write (or lazy copy), so if you assign one variable to another it does not duplicate its contents - until you actually change it.

So, if you simply copy a variable and don't change it, you will not use any more memory.


Thread source:: http://www.webmasterworld.com/php/4178323.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com