How does this function really work?  I've been
beating my head against the wall for the last
8 hours trying to figure it out.  This is what
I'm trying and it isn't working:
{this is a very simplified version}

class MyClass {
  function myFunc( $stringVar, $arrayVar ) {
    echo "$stringVar<br>\n";
    echo "<pre>\n";
    print_r( $arrayVar );
    echo "</pre>\n";

  }
}

$myClass = new MyClass();

$myStringVar = "Hello!";
$myArrayVar  = array( "this" => "that" );

call_user_method_array( 'myFunc', 
                        &$myClass,
                        array( $myStringVar, $myArrayVar ));

What's happening is that the values in the array 
are not being passed individually but instead is
being passed as an array.  Shouldn't it be passing
them individually?  If not, it wouldn't seem as if
you could use this function generically.  You'd have
to specificy write your method so it can (possibly)
be called by this function.  And that just doesn't
seem right.

Any light anyone can shed on this would be very much
appreciated!!

Chris

Reply via email to