QuickBooks/Callbacks.php
static protected function _callFunction($function, &$vars, &$err, $which = null)
	{
		if (!function_exists($function))
		{
			$err = 'Callback does not exist: [function] ' . $function . '(...)';
			return false;
		}

		$ret = call_user_func_array($function, $vars);

		if (!is_null($which))
		{
			$err = $vars[$which];
		}

		return $ret;
	}
static protected function _callFunction($function, &$vars, &$err, $which = null)
	{
		if (!function_exists($function))
		{
			$err = 'Callback does not exist: [function] ' . $function . '(...)';
			return false;
		}

		$ret = call_user_func_array($function, $vars);

		if (!is_null($which))
		{
			$err = $vars[$which];
		}

		return $ret;
	}
Call a callback function

@param string $function		A valid function name
@param array $vars			An array of arguments to the function
@param string $err			An error message will be passed back to this if an error occurs
@param integer $which		If you want a particular $var to be passed the error message, specify which $var as an integer here (i.e. 0 to fill $var[0], 1 to fill $var[1], etc.)
@return mixed