noidtluom Posted November 9, 2007 Share Posted November 9, 2007 Well, first off, look at the code below. It's very easy to understand: <?php class bar { public function anothertest($foo, $bar, $baz) { echo $this->asdf; $num = func_num_args(); echo $num; } } $self = array('a', 'b', 'c', 'd'); print_r($self); $bar = new bar(); $bar->anothertest(); ?> Now, I want to find out how many arguments "anothertest" has before calling it. So if it has three arguments, I will do $bar->anothertest($self['0'], $self['1'], $self['2']); func_num_args can only be called inside the function, so I don't think that will work. How can it be done? Quote Link to comment Share on other sites More sharing options...
cooldude832 Posted November 9, 2007 Share Posted November 9, 2007 why would u need to know that? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.