Re:Let's make the web faster: PHP performance tips by Google
by eropple on Friday June 03, 2011 @02:44AM
(#2615406)
Memory cleanup isn't free (the instance of $description in scope), and unless you return by-reference, you're making a double copy.
[ Parent
| on HN ]
Re:Let's make the web faster: PHP performance tips by Google
by smalyshev on Friday June 03, 2011 @04:24AM
(#2615571)
Both versions of the code do exactly the same:
1. Take description from memory
2. Allocate string and put the stripped version there
3. Output the string (here you might save if you don't use output buffering since no copying to the buffer happens but just output)
4. Release the memory allocated in 2.