note 72143 deleted from function.implode by hholzgra
| From: | hholzgra@php.net | Date: | Thu, 02 Aug 2012 13:17:56 +0000 |
| Subject: | note 72143 deleted from function.implode by hholzgra | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-189738@lists.php.net to get a copy of this message | ||
Note Submitter: ahigerd at stratitec dot com
----
Note that PHP uses copy-on-write so passing parameters (even array parameters) by reference gains
you no performance benefit, and in fact in some cases can HURT performance.
For example:
php > $array = array('a','s','d','f');
php > $start = microtime(true); for($i=0; $i<1000000; $i++) byref($array); echo
microtime(true)-$start;
2.40807890892
php > $start = microtime(true); for($i=0; $i<1000000; $i++) byval($array); echo
microtime(true)-$start;
1.40822386742