original_string: public static function uncomment_rfc822($string)
  	{
  		$string = (string) $string;
  		$position = 0;
  		$length = strlen($string);
  		$depth = 0;
  
  		$output = '';
  
  		while ($position < $length && ($pos = strpos($string, '(', $position)) !== false)
  		{
  			$output .= substr($string, $position, $pos - $position);
  			$position = $pos + 1;
  			if ($string[$pos - 1] !== '\\')
  			{
  				$depth++;
  				while ($depth && $position < $length)
  				{
  					$position += strcspn($string, '()', $position);
  					if ($string[$position - 1] === '\\')
  					{
  						$position++;
  						continue;
  					}
  					elseif (isset($string[$position]))
  					{
  						switch ($string[$position])
  						{
  							case '(':
  								$depth++;
  								break;
  
  							case ')':
  								$depth--;
  								break;
  						}
  						$position++;
  					}
  					else
  					{
  						break;
  					}
  				}
  			}
  			else
  			{
  				$output .= '(';
  			}
  		}
  		$output .= substr($string, $position);
  
  		return $output;
  	}
code: public static function uncomment_rfc822($string)
  	{
  		$string = (string) $string;
  		$position = 0;
  		$length = strlen($string);
  		$depth = 0;
  
  		$output = '';
  
  		while ($position < $length && ($pos = strpos($string, '(', $position)) !== false)
  		{
  			$output .= substr($string, $position, $pos - $position);
  			$position = $pos + 1;
  			if ($string[$pos - 1] !== '\\')
  			{
  				$depth++;
  				while ($depth && $position < $length)
  				{
  					$position += strcspn($string, '()', $position);
  					if ($string[$position - 1] === '\\')
  					{
  						$position++;
  						continue;
  					}
  					elseif (isset($string[$position]))
  					{
  						switch ($string[$position])
  						{
  							case '(':
  								$depth++;
  								break;
  
  							case ')':
  								$depth--;
  								break;
  						}
  						$position++;
  					}
  					else
  					{
  						break;
  					}
  				}
  			}
  			else
  			{
  				$output .= '(';
  			}
  		}
  		$output .= substr($string, $position);
  
  		return $output;
  	}
code_tokens: public static function uncomment_rfc822 ( $ string ) { $ string = ( string ) $ string ; $ position = 0 ; $ length = strlen ( $ string ) ; $ depth = 0 ; $ output = '' ; while ( $ position < $ length && ( $ pos = strpos ( $ string , '(' , $ position ) ) !== false ) { $ output .= substr ( $ string , $ position , $ pos - $ position ) ; $ position = $ pos + 1 ; if ( $ string [ $ pos - 1 ] !== '\\' ) { $ depth ++ ; while ( $ depth && $ position < $ length ) { $ position += strcspn ( $ string , '()' , $ position ) ; if ( $ string [ $ position - 1 ] === '\\' ) { $ position ++ ; continue ; } elseif ( isset ( $ string [ $ position ] ) ) { switch ( $ string [ $ position ] ) { case '(' : $ depth ++ ; break ; case ')' : $ depth -- ; break ; } $ position ++ ; } else { break ; } } } else { $ output .= '(' ; } } $ output .= substr ( $ string , $ position ) ; return $ output ; }
docstring: Remove RFC822 comments
  
  @param string $data Data to strip comments from
  @return string Comment stripped string
docstring_tokens: Remove RFC822 comments