Merge pull request #715 from pestphp/fix/method-names

[2.x] Fix `ふが` type of chars
This commit is contained in:
Nuno Maduro
2023-03-21 16:55:57 +00:00
committed by GitHub
2 changed files with 59 additions and 1 deletions

View File

@ -61,7 +61,8 @@ final class Str
{
$code = self::PREFIX.str_replace(' ', '_', $code);
return (string) preg_replace('/[^A-Z_a-z0-9]/', '_', $code);
// sticks to PHP8.2 function naming rules https://www.php.net/manual/en/functions.user-defined.php
return (string) preg_replace('/[^a-zA-Z0-9_\x80-\xff]/', '_', $code);
}
/**