Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 720fc79

Browse files
Link to original implementation
1 parent 3a6ea8f commit 720fc79

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

‎src/Parser/ConstExprParser.php‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,9 @@ private static function unescapeString(string $string): string
171171
return self::parseEscapeSequences(substr($string, 1, -1), '"');
172172
}
173173

174+
/**
175+
* Implementation based on https://github.com/nikic/PHP-Parser/blob/b0edd4c41111042d43bb45c6c657b2e0db367d9e/lib/PhpParser/Node/Scalar/String_.php#L90-L130
176+
*/
174177
private static function parseEscapeSequences(string $str, string $quote): string
175178
{
176179
$str = str_replace('\\' . $quote, $quote, $str);
@@ -196,6 +199,9 @@ static function ($matches) {
196199
);
197200
}
198201

202+
/**
203+
* Implementation based on https://github.com/nikic/PHP-Parser/blob/b0edd4c41111042d43bb45c6c657b2e0db367d9e/lib/PhpParser/Node/Scalar/String_.php#L132-L154
204+
*/
199205
private static function codePointToUtf8(int $num): string
200206
{
201207
if ($num <= 0x7F) {

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /