Re: Parsing database variables

From: Date: Sat, 31 Mar 2007 15:56:00 +0000
Subject: Re: Parsing database variables
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-251837@lists.php.net to get a copy of this message
Myron Turner wrote: > Jake McHenry wrote: ... >> >> >> > I would suggest writing a function in which the parameters are passed in > as references. In the function itself have set a variables using the > heredoc syntax, which incorporates the variables, and then return the > heredoc variable. Coming from Perl, my impulse is to use a reference for > the return value, but the manual says not to, that PHP is smart enough > to know how to optimize itself. Perhaps someone can tell us whether the > same is true for the parameters. The manual is mum on that one. same is true for the parameters. don't use references unless you need to - namely when you expect to actually change the passed in value. > > > function set_func(&$var1, &$var2 . . . &var17) { > $return_var = RETURNVAR > "this is $var1 and $var2. . . ."; > RETURNVAR ; > > return $return_var; > > } > > _____________________ > Myron Turner > http://www.room535.org > http://www.bstatzero.org > http://www.mturner.org/XML_PullParser/ >

« previous php.general (#251837) next »