Return Values Copied? Copied if By Reference?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Is a function return value copied? If the value is an integer I suppose
it is but what about a string or an array? If you pass by reference is
the return value still copied?

For example, is this:

  function foo(&$arr) {
      $arr[] = "bar";
  }

faster than this?

  function foo(&$arr) {
      $arr[] = "bar";
      return $arr; // is this copied?
  }

I'm working on some code that would be called to generate a cell in a
possibly large table and therefore a small difference in performance
may have a significant impact.

Thanks,
Mike

-- 
Michael B Allen
PHP Extension for SSO w/ Windows Group Authorization
http://www.ioplex.com/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux