Copy-on-write \ Lazy Copy Mechanism
| From: | Shaked Klein | Date: | Mon, 22 Mar 2010 18:09:15 +0000 |
| Subject: | Copy-on-write \ Lazy Copy Mechanism | ||
| Groups: | php.webmaster | ||
| Request: | Send a blank email to php-webmaster+get-7670@lists.php.net to get a copy of this message | ||
Hey,
I started to learn for the Zend Certificate exam a few days ago and I got
stuck with one unanswered-well question.
This is the question:
“Absent any actual need for choosing one method over the other, does passing
arrays by value to a read-only function reduce performance compared to
passing them by reference?’
The answers speaks about Lazy Copy Mechanism\Copy-on-Write.
I tried to search at php.net and google.com about how this mechanism works,
and unfortunately there were no results.
I`m trying to understand what is the deference between passing array by
value (when readonly) and passing array by reference, and why passing the
array by value is faster?
Thank you for your answer,
Have a nice day, Shaked.