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

Appearance settings

Commit bdc7d4c

Browse filesBrowse files
committed
minor #12791 Fix UnicodeString::fromCodePoints() example (jdreesen)
This PR was merged into the 5.0 branch. Discussion ---------- Fix `UnicodeString::fromCodePoints()` example `UnicodeString::fromCodePoints()` returns a `UnicodeString` so the next line `// $foo = 'नमस्ते'` is not correct as it implies the result to be a `string`. Thus, the result should be casted to a `string` (or `->toString()` should be called) to match the comment. Commits ------- 6793fbe Fix UnicodeString::fromCodePoints example
2 parents 845b6c4 + 6793fbe commit bdc7d4c
Copy full SHA for bdc7d4c

File tree

Expand file treeCollapse file tree

1 file changed

+1
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+1
-1
lines changed

‎components/string.rst

Copy file name to clipboardExpand all lines: components/string.rst
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ There are also some specialized constructors::
125125
$foo = ByteString::fromRandom(12);
126126

127127
// CodePointString and UnicodeString can create a string from code points
128-
$foo = UnicodeString::fromCodePoints(0x928, 0x92E, 0x938, 0x94D, 0x924, 0x947);
128+
$foo = (string) UnicodeString::fromCodePoints(0x928, 0x92E, 0x938, 0x94D, 0x924, 0x947);
129129
// $foo = 'नमस्ते'
130130

131131
Methods to Transform String Objects

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.