I happens to read this http://code.google.com/speed/articles/optimizing-php.html
It claims that this code
$description = strip_tags($_POST['description']); echo $description; should be optimized as below
echo strip_tags($_POST['description']); However, in my understanding, assignment operation in PHP is not necessarily create a copy in memory.
This only have one copy of "abc" in memory.
$a = $b = "abc"; It consumes more memory only when one variable is changed.
$a = $b = "abc"; $a = "xyz"; Is that correct?
$descriptionlater on? Doesn't that imply that the string is being stored in memory? The second chunk, though, can't be referenced again. You'd have to re-evaluate the function once more to get the same output.