Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]: preg_replace_callback cannot find method #2321

Open
niden opened this issue Nov 2, 2021 · 0 comments
Open

[BUG]: preg_replace_callback cannot find method #2321

niden opened this issue Nov 2, 2021 · 0 comments
Assignees
Labels

Comments

@niden
Copy link
Contributor

niden commented Nov 2, 2021

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.

@niden niden changed the title preg_replace_callback cannot find method [BUG]: preg_replace_callback cannot find method Nov 2, 2021
@niden niden added the bug label Nov 2, 2021
@Jeckerson Jeckerson added this to the 0.16.0 milestone Nov 3, 2021
@Jeckerson Jeckerson self-assigned this Nov 3, 2021
Jeckerson added a commit that referenced this issue Nov 12, 2021
Jeckerson added a commit that referenced this issue Nov 13, 2021
Jeckerson added a commit that referenced this issue Nov 13, 2021
Jeckerson added a commit that referenced this issue Nov 13, 2021
Jeckerson added a commit that referenced this issue Nov 14, 2021
Jeckerson added a commit that referenced this issue Nov 21, 2021
Jeckerson added a commit that referenced this issue Nov 29, 2021
Jeckerson added a commit that referenced this issue Mar 26, 2022
# Conflicts:
#	Library/CompilerFile.php
#	composer.lock
#	config/autoload.php
#	phpunit.xml.dist
#	tests/ext-bootstrap.php
#	zephir
@Jeckerson Jeckerson removed this from the 0.16.0 milestone Apr 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants