Re: [PHP4BETA] [PHP4Beta] - reference question
| From: | Andi Gutmans | Date: | Sun, 06 Feb 2000 05:24:45 +0000 |
| Subject: | Re: [PHP4BETA] [PHP4Beta] - reference question | ||
| References: | 1 | Groups: | php.version4 |
| Request: | Send a blank email to php-version4+get-9870@lists.php.net to get a copy of this message | ||
By the way, I just want to add something to this mail. Unless you really intend to change the array within your function you should pass the array by value. There is no performance hit sending it by value.
Andi
At 06:53 AM 2/6/00 +0200, Andi Gutmans wrote:
Sure you can. function foo(&ar) {--- Andi Gutmans <andi@zend.com> http://www.zend.com/$ar[0] = 1;} $arr = array(1,2,3); foo($arr); The & in the function declaration specifies that the argument is being passed by reference. Andi At 02:11 PM 2/5/00 -0800, Brett M. Delia wrote:Just getting up and running on using PHP. I am currently using PHP4 and would like to know if you can pass arrays as reference variables to functions? Any help would be appreciated as I can't get a concrete answer from the online manual. Thanks, -- Brett M. Delia Software Engineer/Web Developer Active Arts Software Tel 503.684.5806 x775 brett_delia@activearts.com http://www.activearts.com - http://www.sportsmvp.com Do what you can, with what you have, where you are.--- Andi Gutmans <andi@zend.com> http://www.zend.com/ -- PHP 4.0 Beta Mailing List <http://www.php.net/version4/> To unsubscribe, e-mail: php4beta-unsubscribe@lists.php.net For additional commands, e-mail: php4beta-help@lists.php.net To contact the list administrators, e-mail: php4beta-admin@lists.php.net--Theodore RooseveltI have simply tried to do what seemed best each day, as each day came.-- Abraham Lincoln-- PHP 4.0 Beta Mailing List <http://www.php.net/version4/> To unsubscribe, e-mail: php4beta-unsubscribe@lists.php.net For additional commands, e-mail: php4beta-help@lists.php.net To contact the list administrators, e-mail: php4beta-admin@lists.php.net