original_string: public function addFunction($function, $namespace = '')
      {
          if (!is_string($function) && !is_array($function)) {
              require_once 'Zend/Amf/Server/Exception.php';
              throw new Zend_Amf_Server_Exception('Unable to attach function');
          }
  
          $argv = null;
          if (2 < func_num_args()) {
              $argv = array_slice(func_get_args(), 2);
          }
  
          $function = (array) $function;
          foreach ($function as $func) {
              if (!is_string($func) || !function_exists($func)) {
                  require_once 'Zend/Amf/Server/Exception.php';
                  throw new Zend_Amf_Server_Exception('Unable to attach function');
              }
              $this->_methods[] = Zend_Server_Reflection::reflectFunction($func, $argv, $namespace);
          }
  
          $this->_buildDispatchTable();
          return $this;
      }
code: public function addFunction($function, $namespace = '')
      {
          if (!is_string($function) && !is_array($function)) {
              require_once 'Zend/Amf/Server/Exception.php';
              throw new Zend_Amf_Server_Exception('Unable to attach function');
          }
  
          $argv = null;
          if (2 < func_num_args()) {
              $argv = array_slice(func_get_args(), 2);
          }
  
          $function = (array) $function;
          foreach ($function as $func) {
              if (!is_string($func) || !function_exists($func)) {
                  require_once 'Zend/Amf/Server/Exception.php';
                  throw new Zend_Amf_Server_Exception('Unable to attach function');
              }
              $this->_methods[] = Zend_Server_Reflection::reflectFunction($func, $argv, $namespace);
          }
  
          $this->_buildDispatchTable();
          return $this;
      }
code_tokens: public function addFunction ( $ function , $ namespace = '' ) { if ( ! is_string ( $ function ) && ! is_array ( $ function ) ) { require_once 'Zend/Amf/Server/Exception.php' ; throw new Zend_Amf_Server_Exception ( 'Unable to attach function' ) ; } $ argv = null ; if ( 2 < func_num_args ( ) ) { $ argv = array_slice ( func_get_args ( ) , 2 ) ; } $ function = ( array ) $ function ; foreach ( $ function as $ func ) { if ( ! is_string ( $ func ) || ! function_exists ( $ func ) ) { require_once 'Zend/Amf/Server/Exception.php' ; throw new Zend_Amf_Server_Exception ( 'Unable to attach function' ) ; } $ this -> _methods [ ] = Zend_Server_Reflection :: reflectFunction ( $ func , $ argv , $ namespace ) ; } $ this -> _buildDispatchTable ( ) ; return $ this ; }
docstring: Attach a function to the server
  
  Additional arguments to pass to the function at dispatch may be passed;
  any arguments following the namespace will be aggregated and passed at
  dispatch time.
  
  @param  string|array $function Valid callback
  @param  string $namespace Optional namespace prefix
  @return Zend_Amf_Server
  @throws Zend_Amf_Server_Exception
docstring_tokens: Attach a function to the server