Better HN
topnewbestaskshowjobs
Log inSign up

smalyshev

14 karma · joined Feb 17, 2011 (15y ago) · 3 submissions

Submissions

comment 15y ago · link · parent

$foo = $_POST['barf'] does not copy data.

comment 15y ago · link · parent

Unfortunately, these tips were written by somebody who does not understand how PHP works. See detailed critique of the previous version here: https://php100.wordpress.com/2009/06/26/php-performance-goog... The article may have changed since then but some of the points are still valid. It also doesn't mention current stable version of PHP (5.3) and still has no mention of bytecode caching. At least it mentions profiling now...

comment 15y ago · link · parent

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.