Re: Passing arrays by reference

From: Date: Mon, 09 Aug 2004 21:51:58 +0000
Subject: Re: Passing arrays by reference
References: 1  Groups: php.windows 
Request: Send a blank email to php-windows+get-24374@lists.php.net to get a copy of this message
On Mon, 9 Aug 2004 17:28:40 -0400, Jim MacDiarmid <jim.macdiarmid@comcast.net> 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--

« previous php.windows (#24374) next »