Skip to content

unnecessary PREG_OFFSET_CAPTURE usage (?) #110

Open
@ViliusS

Description

@ViliusS

Just wondering is PREG_OFFSET_CAPTURE is needed here

$count = preg_match_all($this->lexerRegex, $text, $matches, PREG_SET_ORDER | PREG_OFFSET_CAPTURE);

I don't see offset used anywhere in the following code however during tests I found that it uses up memory pretty heavily. If I did my testing right, in one case preg_match_all() uses up 80 MB with PREG_OFFSET_CAPTURE and 23 MB without.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions