@everzet I've created simple benchmark https://gist.github.com/kibao/a25de6772ed0b6de12e8 .
As you can see ``mb_strpos`` is slower than ``explode`` with ``in_array`` (even if in each iteration arrays are exploded).

I think the best way to optimize this method is to save ``keywordTypes`` in property in ``Lexer``.