protected function _isFunction( &$name, array &$params )
	{
		$len = strlen( $name );
		if( $len === 0 || $name[$len-1] !== ')' ) { return false; }

		if( ( $pos = strpos( $name, '(' ) ) === false ) {
			throw new MW_Common_Exception( 'Missing opening bracket for function syntax' );
		}

		if( ( $paramstr = substr( $name, $pos, $len - $pos ) ) === false ) {
			throw new MW_Common_Exception( 'Unable to extract function parameter' );
		}

		if( ( $namestr = substr( $name, 0, $pos ) ) === false ) {
			throw new MW_Common_Exception( 'Unable to extract function name' );
		}

		$matches = array();
		$pattern = '/(\[[^\]]*\]|"[^"]*"|[0-9]+\.[0-9]+|[0-9]+),?/';

		if( preg_match_all( $pattern, $paramstr, $matches ) === false ) {
			throw new MW_Common_Exception( 'Unable to extract function parameters' );
		}

		if( isset( $matches[1] ) ) {
			$params = $this->_extractParams( $matches[1] );
		}

		$name = $namestr . '()';
		return true;
	}
protected function _isFunction( &$name, array &$params )
	{
		$len = strlen( $name );
		if( $len === 0 || $name[$len-1] !== ')' ) { return false; }

		if( ( $pos = strpos( $name, '(' ) ) === false ) {
			throw new MW_Common_Exception( 'Missing opening bracket for function syntax' );
		}

		if( ( $paramstr = substr( $name, $pos, $len - $pos ) ) === false ) {
			throw new MW_Common_Exception( 'Unable to extract function parameter' );
		}

		if( ( $namestr = substr( $name, 0, $pos ) ) === false ) {
			throw new MW_Common_Exception( 'Unable to extract function name' );
		}

		$matches = array();
		$pattern = '/(\[[^\]]*\]|"[^"]*"|[0-9]+\.[0-9]+|[0-9]+),?/';

		if( preg_match_all( $pattern, $paramstr, $matches ) === false ) {
			throw new MW_Common_Exception( 'Unable to extract function parameters' );
		}

		if( isset( $matches[1] ) ) {
			$params = $this->_extractParams( $matches[1] );
		}

		$name = $namestr . '()';
		return true;
	}
protected function _isFunction ( & $ name , array & $ params ) { $ len = strlen ( $ name ) ; if ( $ len === 0 || $ name [ $ len - 1 ] !== ')' ) { return false ; } if ( ( $ pos = strpos ( $ name , '(' ) ) === false ) { throw new MW_Common_Exception ( 'Missing opening bracket for function syntax' ) ; } if ( ( $ paramstr = substr ( $ name , $ pos , $ len - $ pos ) ) === false ) { throw new MW_Common_Exception ( 'Unable to extract function parameter' ) ; } if ( ( $ namestr = substr ( $ name , 0 , $ pos ) ) === false ) { throw new MW_Common_Exception ( 'Unable to extract function name' ) ; } $ matches = array ( ) ; $ pattern = '/(\[[^\]]*\]|"[^"]*"|[0-9]+\.[0-9]+|[0-9]+),?/' ; if ( preg_match_all ( $ pattern , $ paramstr , $ matches ) === false ) { throw new MW_Common_Exception ( 'Unable to extract function parameters' ) ; } if ( isset ( $ matches [ 1 ] ) ) { $ params = $ this -> _extractParams ( $ matches [ 1 ] ) ; } $ name = $ namestr . '()' ; return true ; }
Checks if the given string is an expression function and returns the parameters.
The parameters will be cut off the function name and will be added to
the given parameter array

@param string $name Function string to check, will be cut to <function>() (without parameter)
@param array $params Array that will contain the list of parameters afterwards
@return boolean True if string is an expression function, false if not
Checks if the given string is an expression function and returns the parameters . The parameters will be cut off the function name and will be added to the given parameter array