& performance issues

From: Date: Thu, 17 Apr 2008 03:37:47 +0000
Subject: & performance issues
Groups: php.general 
Request: Send a blank email to php-general+get-273139@lists.php.net to get a copy of this message
all, i have heard from various sources that using the & in php can at times be costly, and therefore, it should not be used when it is not needed. for example, passing an array by reference because you think youre passing the actual array is not a good idea. only pass it by reference if a modified version needs to be handed to the calling code via an actual parameter. im also wondering about php4 code thats now running under 5; such as function &returnObject() ... $a =& new SomeClass() ... lets suppose, for the sake of arguments, i have my hands on a codebase where everything actually does count. the code was php4 and is now transitioning to 5. does anybody know if there would be a performance gain in running the whole thing through sed to try and strip out the unnecessary & characters ? any empirical data? thx, -nathan

« previous php.general (#273139) next »