I'm calling an objects method through call_user_func_array to which I pass dynamic string arguments depending on a couple of parameters.
It currently look similar to this:
<?php
class MyObject
{
public function do_Procedure ($arg1 = "", $arg2 = "")
{ /* do whatever */ }
public function do_Something_Else (AnotherObject $arg1 = null)
{ /* This method requires the first parameter to
be an instance of AnotherObject and not String */ }
}
call_user_func_array(array($object, $method), $arguments);
?>
This works for method $method = 'do_Procedure' but if I wanted to call the $method = 'do_Something_Else' method which requires the first argument to be an instance of AnotherObject I get an E_RECOVERABLE_ERROR error.
How do I know which type of instance that should be passed? E.g. if this method requires an object instance but the first processed argument is of string, how do I recognize this so that I can pass null instead or simply skip the call?
trying to call xxx on a none object.