Passing arrays by reference

From: Date: Mon, 09 Aug 2004 21:28:40 +0000
Subject: Passing arrays by reference
Groups: php.windows 
Request: Send a blank email to php-windows+get-24372@lists.php.net to get a copy of this message
Hi everyone, I've seen several examples of passing arrays by reference such as the following: $a = array(); 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

« previous php.windows (#24372) next »