[doc-en] master: docs(locale.getKeywords): clarify return values and empty string argument (#5844)

From: Date: Mon, 07 Sep 2026 21:04:11 +0000
Subject: [doc-en] master: docs(locale.getKeywords): clarify return values and empty string argument (#5844)
Groups: php.doc.cvs 
Request: Send a blank email to doc-cvs+get-23724@lists.php.net to get a copy of this message
Author: Louis-Arnaud (lacatoire) Committer: GitHub (web-flow) Pusher: lacatoire Date: 2026-09-07T23:04:08+02:00 Commit: https://github.com/php/doc-en/commit/d8de774ae203bccf3ffe02895d8c8fc754377451 Raw diff: https://github.com/php/doc-en/commit/d8de774ae203bccf3ffe02895d8c8fc754377451.diff docs(locale.getKeywords): clarify return values and empty string argument (#5844) Changed paths: M reference/intl/locale/get-keywords.xml Diff: diff --git a/reference/intl/locale/get-keywords.xml b/reference/intl/locale/get-keywords.xml index ff6b004b6036..9e0a03ca2251 100644 --- a/reference/intl/locale/get-keywords.xml +++ b/reference/intl/locale/get-keywords.xml @@ -35,9 +35,11 @@ <varlistentry> <term><parameter>locale</parameter></term> <listitem> - <para> - The locale to extract the keywords from - </para> + <simpara> + The locale to extract the keywords from. If an empty string is + passed, the value returned by <function>locale_get_default</function> + is used instead. + </simpara> </listitem> </varlistentry> </variablelist> @@ -47,9 +49,10 @@ <refsect1 role="returnvalues"> &reftitle.returnvalues; - <para> - Associative <type>array</type> containing the keyword-value pairs for this locale - </para> + <simpara> + Associative <type>array</type> containing the keyword-value pairs for this locale, + &null; if the locale has no keywords, or &false; on failure. + </simpara> &intl.locale-len.return; </refsect1> @@ -61,7 +64,7 @@ <![CDATA[ <?php $keywords_arr = locale_get_keywords('de_DE@currency=EUR;collation=PHONEBOOK'); -if ($keywords_arr) { +if (is_array($keywords_arr)) { foreach ($keywords_arr as $key => $value) { echo "$key = $value\n"; } @@ -76,7 +79,7 @@ if ($keywords_arr) { <![CDATA[ <?php $keywords_arr = Locale::getKeywords('de_DE@currency=EUR;collation=PHONEBOOK'); -if ($keywords_arr) { +if (is_array($keywords_arr)) { foreach ($keywords_arr as $key => $value) { echo "$key = $value\n"; } @@ -99,6 +102,8 @@ currency = EUR <para> <simplelist> <member><function>locale_get_all_variants</function></member> + <member><function>locale_get_default</function></member> + <member><function>locale_set_default</function></member> </simplelist> </para> </refsect1>

« previous php.doc.cvs (#23724) next »