src/Stemmer/PorterStemmer.php
private static function m($str)
    {
        $c = self::$regex_consonant;
        $v = self::$regex_vowel;

        $str = preg_replace("#^$c+#", '', $str);
        $str = preg_replace("#$v+$#", '', $str);

        preg_match_all("#($v+$c+)#", $str, $matches);

        return count($matches[1]);
    }
private static function m($str)
    {
        $c = self::$regex_consonant;
        $v = self::$regex_vowel;

        $str = preg_replace("#^$c+#", '', $str);
        $str = preg_replace("#$v+$#", '', $str);

        preg_match_all("#($v+$c+)#", $str, $matches);

        return count($matches[1]);
    }
private static function m ( $ str ) { $ c = self :: $ regex_consonant ; $ v = self :: $ regex_vowel ; $ str = preg_replace ( "#^$c+#" , '' , $ str ) ; $ str = preg_replace ( "#$v+$#" , '' , $ str ) ; preg_match_all ( "#($v+$c+)#" , $ str , $ matches ) ; return count ( $ matches [ 1 ] ) ; }
What, you mean it's not obvious from the name?

m() measures the number of consonant sequences in $str. if c is
a consonant sequence and v a vowel sequence, and <..> indicates arbitrary
presence,

<c><v>       gives 0
<c>vc<v>     gives 1
<c>vcvc<v>   gives 2
<c>vcvcvc<v> gives 3

@param  string $str The string to return the m count for
@return int         The m count
What you mean it s not obvious from the name?