Re: Howto re-pass arguments?



J.O. Aho wrote:
zapzap wrote:
Hello :-)
Is it possible to pass all arguments to another function?
function A()
{
B(func_get_args());
}

function B()
{
var_dump(func_get_args());
}
I dont know how many arguments will come for A, and i want
A to handle them transparent and pass all to B.
Now i'm doing this with func_get_args but I get
an array ob B's input. original arguments would be
better. Is this possible in any way?
function b($array) {
if(is_array($array)) {
foreach($array AS $var) {
var_dump($var);
}
} else {
var_dump($array);
}
}

No no no ;-) My fault, see this:

//
function A()
{
B(); // THIS NEEDS TO BE CHANGED PROBLY :>
}

//
function B()
{
var_dump(func_get_args());
}


So, I will NEVER call B directly, i'll always call A
an A will call B for me.

B is loaded/generated dynamicaly, so one time B requires
2 arguments, sometimes 5 arguments. As i said i will
only call A, sometimes A($var1,$var2,$var3), other
A($var1). How can I tell A to pass all its
arguments to B - WITHOUT having them as an array (as result
of fun_get_args in my previous posting).

I hope this is clear now ;-) sorry for my english
.



Relevant Pages

  • Re: PHP-like Array/Hash creation in Ruby
    ... but the autogrowing is limited to the last dimension. ... i dont have constant size of elements that could be added in just one ... want to store them in a 3 dimensional array. ... I do like Ruby very much from the first looks ...
    (comp.lang.ruby)
  • Re: Question about cgi forms (slightly OT)
    ... > If you normalize the CGI input to a sane value (IE, make string zero ... > the order they are placed into the array then you can use array ... dont think I was clear enough ... through the fields, edit etc, but if I do a control F for instance, the ...
    (perl.beginners)
  • Re: look into control array for colission detection
    ... Im sort of new to vb6. ... > array to see if the fire-ball left the screen the unload it. ... > Still good to me that I dont leak mem. ...
    (microsoft.public.vb.controls)
  • Re: macro - delete row if cell contains string
    ... Here is a slightly more complex macro that I really need. ... I think it will probably have something to do with finding the cells ... all cells that contain the contents of that array. ... Unfortunately I dont have the programing language to do this. ...
    (microsoft.public.excel.programming)
  • Re: dynamic arrays in java
    ... generated by the routine as it runs. ... an array cant be used as java seems to insist of the size of the array to be ... where as i say i dont have this information prior to ...
    (comp.lang.java.programmer)