Re: [PHP] func_get_args as a hash? (faster constructors)

2006-11-29 Thread Larry Garfield
On Tuesday 28 November 2006 20:09, Jochem Maas wrote: > Kelly Jones wrote: > > If I define a function like this: > > > > function foo ($x, $y, $z) {} > > > > and then call: foo(1,2,"bar"); > > > > is there a function I can call inside foo() that yields this hash: > > > > {"x" => 1, "y" => 2, "z" =>

Re: [PHP] func_get_args as a hash? (faster constructors)

2006-11-29 Thread Richard Lynch
On Mon, November 27, 2006 7:57 pm, Kelly Jones wrote: > If I define a function like this: > > function foo ($x, $y, $z) {} > > and then call: foo(1,2,"bar"); > > is there a function I can call inside foo() that yields this hash: > > {"x" => 1, "y" => 2, "z" => "bar"} > > In other words, gives me th

Re: [PHP] func_get_args as a hash? (faster constructors)

2006-11-28 Thread Jochem Maas
Kelly Jones wrote: > If I define a function like this: > > function foo ($x, $y, $z) {} > > and then call: foo(1,2,"bar"); > > is there a function I can call inside foo() that yields this hash: > > {"x" => 1, "y" => 2, "z" => "bar"} > > In other words, gives me the values *and names* of the ar

Re: [PHP] func_get_args as a hash? (faster constructors)

2006-11-28 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2006-11-27 18:57:54 -0700: > is there a function I can call inside foo() that yields this hash: > > {"x" => 1, "y" => 2, "z" => "bar"} > > In other words, gives me the values *and names* of the arguments to foo? > > func_get_args just yields the values. > > Having this fun

RE: [PHP] func_get_args as a hash? (faster constructors)

2006-11-28 Thread Vincent DUPONT
Well, I would reply that this is probably as easy to read ... You should think about poeple having digg into your code, or about you in a few month... Moreover, having much parameters (more than 4) is not a good idea (for the same reading and understanding reasons). Functions having more than 4

RE: [PHP] func_get_args...

2003-01-09 Thread Sean Malloy
well upon reading user comments in manual, looks like the only solution is to dump variables into an array, and pass the array to a function with a single defined by-ref parameter, so it kind of defeats the purpose. Oh well. -Original Message- From: Sean Malloy [mailto:[EMAIL PROTECTED]]

Re: [PHP] func_get_args() and call-by-reference?

2003-01-02 Thread Atahualpa Jones
Hi again, Now I did a different approach using an array as parameter and giving an array back. Strangely though it doesnt really work. Following "hack" solution works as expected: $num = pg_numrows($result); for ($i = 0; $i < $num; $i++) { $ret_arr[$i] = pg_fetch_array($result); $ret_arr