Re: Passing arrays by reference

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

 



On Mon, 9 Aug 2004 17:28:40 -0400, Jim MacDiarmid
<jim.macdiarmid@xxxxxxxxxxx> wrote:
> 
> Hi everyone,
> 
> I've seen several examples of passing arrays by reference such as the
> following:
> 
> $a = array();
> 
> function foo(&a)

function foo(&$a)

> {
>         for ($i=0; $i < 10; i++)
>         {
>                 $a[$i] = $i;
>         }
> }
> 
> foo($a);
> echo "<PRE>";
> print_r($a);
> echo "</PRE>";
> 
> However, when I try this on my setup, it doesn't work and I get the
> following error message:
> 
> PHP Parse error:  parse error, unexpected T_STRING, expecting T_VARIABLE
> in...
> 
> Anyone have any ideas or suggestions?
> 
> Thanks,
> Jim
> 
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

-- 
DB_DataObject_FormBuilder - The database at your fingertips
http://pear.php.net/package/DB_DataObject_FormBuilder

paperCrane --Justin Patrin--

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


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux