[BUG]: `preg_replace_callback` cannot find method
niden opened this issue · comments
Nikolaos Dimopoulos commented
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.