zephir-lang / zephir

Zephir is a compiled high-level language aimed to ease the creation of C-extensions for PHP

Home Page:https://zephir-lang.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[BUG]: `preg_replace_callback` cannot find method

niden opened this issue · comments

private function filterQuery(string value) -> string
{
    return preg_replace_callback(
        '/(?:[^%:!\$&\'\(\)\*\+,;=@\/\?]+|%(?![A-Fa-f0-9]{2}))/u',
        [this, 'doUrlEncode'],
        value
    );
}

private function doUrlEncode(array matches) -> string
{
    return rawurlencode(matches[0]);
}

The above produces an error that it cannot access doUrlEncode. It is the same if the method is protected or static.