Re: scope and return array( ); problems

From: Date: Thu, 19 Apr 2007 03:08:00 +0000
Subject: Re: scope and return array( ); problems
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-253227@lists.php.net to get a copy of this message
On Wed, April 18, 2007 5:33 pm, Yvan Strahm wrote: > I have this function: > > function preg_array($pattern, $array, $r_array) > { > global $match; > global $r_array; Passing in $r_array *AND* declaring it global is just plain silly. Do one or the other, but not both. If the array is LARGE, you may also want to consider writing this with array_map and a create_function so that you can have the iteration happening in C instead of in PHP... -- Some people have a "gift" link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So?

« previous php.general (#253227) next »