[doc-en] master: Correct expected output in intl examples (#6051)
| From: | Tim Bond via GitHub | Date: | Tue, 10 Nov 2026 06:52:17 +0000 |
| Subject: | [doc-en] master: Correct expected output in intl examples (#6051) | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-23928@lists.php.net to get a copy of this message | ||
Author: Tim Bond (cookieguru)
Committer: GitHub (web-flow)
Pusher: lacatoire
Date: 2026-11-10T07:52:14+01:00
Commit: https://github.com/php/doc-en/commit/30c3158d5da85f4910b27c2179d02a7cfb30b0c1
Raw diff: https://github.com/php/doc-en/commit/30c3158d5da85f4910b27c2179d02a7cfb30b0c1.diff
Correct expected output in intl examples (#6051)
The expected output in these examples did not match what the code
prints on current PHP (8.5, ICU 77.1):
* IntlChar::charMirror() and IntlChar::totitle() showed wrong byte
lengths, and totitle() of "φ" is "Φ"
* Locale::getDisplayName() showed an escaped byte sequence, a missing
parenthesis and an outdated German variant name
* collator_set_strength() printed both arrays on one line, and the
primary-strength sort keeps the input order since sorting became
stable in PHP 8.0
Changed paths:
M reference/intl/collator/set-strength.xml
M reference/intl/intlchar/charmirror.xml
M reference/intl/intlchar/totitle.xml
M reference/intl/locale/get-display-name.xml
Diff:
diff --git a/reference/intl/collator/set-strength.xml b/reference/intl/collator/set-strength.xml
index 5dd1820f60aa..5754815fe5b9 100644
--- a/reference/intl/collator/set-strength.xml
+++ b/reference/intl/collator/set-strength.xml
@@ -195,6 +195,7 @@ $coll = collator_create( 'en_US' );
// Sort array using default strength.
collator_sort( $coll, $arr );
var_export( $arr );
+echo PHP_EOL;
// Sort array using primary strength.
collator_set_strength( $coll, Collator::PRIMARY );
@@ -212,9 +213,9 @@ array (
2 => 'aò',
)
array (
- 0 => 'aò',
+ 0 => 'ao',
1 => 'Ao',
- 2 => 'ao',
+ 2 => 'aò',
)
]]>
</screen>
diff --git a/reference/intl/intlchar/charmirror.xml b/reference/intl/intlchar/charmirror.xml
index 6ad9f7844551..ca53889a4626 100644
--- a/reference/intl/intlchar/charmirror.xml
+++ b/reference/intl/intlchar/charmirror.xml
@@ -63,7 +63,7 @@ var_dump(IntlChar::charMirror("("));
<![CDATA[
string(1) "A"
string(1) ">"
-string(2) ")"
+string(1) ")"
]]>
</screen>
</example>
diff --git a/reference/intl/intlchar/totitle.xml b/reference/intl/intlchar/totitle.xml
index 74ffe3bcb7fa..1583d61089f8 100644
--- a/reference/intl/intlchar/totitle.xml
+++ b/reference/intl/intlchar/totitle.xml
@@ -59,12 +59,12 @@ var_dump(IntlChar::totitle(ord("A")));
&example.outputs;
<screen>
<![CDATA[
-string(1) "Dž"
-string(1) "Dž"
+string(2) "Dž"
+string(2) "Dž"
+string(2) "Φ"
string(2) "Φ"
-string(2) "φ"
string(1) "1"
-string(1) "ᾼ"
+string(3) "ᾼ"
int(65)
]]>
</screen>
diff --git a/reference/intl/locale/get-display-name.xml b/reference/intl/locale/get-display-name.xml
index d3cc46594b8b..fd2b4f5d3c0b 100644
--- a/reference/intl/locale/get-display-name.xml
+++ b/reference/intl/locale/get-display-name.xml
@@ -115,9 +115,9 @@ echo Locale::getDisplayName('sl-Latn-IT-nedis', 'de');
<screen>
<![CDATA[
Slovenian (Latin, Italy, Natisone dialect);
-slov\xc3\xa8ne (latin, Italie, dialecte de Natisone;
-Slowenisch (Lateinisch, Italien, NEDIS)
- ]]>
+slovène (latin, Italie, dialecte de Natisone);
+Slowenisch (Lateinisch, Italien, Natisone-Dialekt)
+]]>
</screen>
</example>
</refsect1>