At 01:25 AM 1/3/03 -0200, Fernando Serboncini wrote:
function a(myclass c) { return c; } would create another copy of "c" in memory. Things get a bit larger when you go with linked-list like structures in classes, where you have to take really good care to don't duplicate data. If you're not taking care, then maybe 5MB is normal.
Not really. PHP has its own method of handling variables which does not make a copy of data unless it has to. See:
http://www.zend.com/zend/art/ref-count.php
This may be the most important paragraph in the article:
Note that PHP 4 is not like C: passing variables by reference is not
necessarily faster than passing them by value. Indeed, in PHP 4 it is
usually better to pass a variable by value, except if the function
changes the passed value or if a reference is being passed.
Rick
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php