-
Notifications
You must be signed in to change notification settings - Fork 813
[PHP 8.4] Add mb_* functions #3922
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 4 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
b8ee07a
[PHP 8.4] Add mb_* functions
saundefined 4e94510
[PHP 8.4] Add mb_* functions
saundefined c3d65aa
Apply suggestions from code review
saundefined e575fe8
Move characters parameter to entity
saundefined c65d77f
Apply suggestions from code review
saundefined File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<refentry xml:id="function.mb-lcfirst" xmlns="http://docbook.org/ns/docbook"> | ||
<refnamediv> | ||
<refname>mb_lcfirst</refname> | ||
<refpurpose>Make a string's first character lowercase</refpurpose> | ||
</refnamediv> | ||
|
||
<refsect1 role="description"> | ||
&reftitle.description; | ||
<methodsynopsis> | ||
<type>string</type><methodname>mb_lcfirst</methodname> | ||
<methodparam><type>string</type><parameter>string</parameter></methodparam> | ||
<methodparam choice="opt"><type>string</type><parameter>encoding</parameter><initializer>&null;</initializer></methodparam> | ||
</methodsynopsis> | ||
<simpara> | ||
Performs a multi-byte safe <function>lcfirst</function> operation, | ||
and returns a string with the first character of | ||
<parameter>string</parameter> lowercased if that character is | ||
an ASCII character in the range <literal>"A"</literal> (0x41) to | ||
<literal>"Z"</literal> (0x5a). | ||
</simpara> | ||
</refsect1> | ||
|
||
<refsect1 role="parameters"> | ||
&reftitle.parameters; | ||
<variablelist> | ||
<varlistentry> | ||
<term><parameter>string</parameter></term> | ||
<listitem> | ||
<simpara> | ||
The input string. | ||
</simpara> | ||
</listitem> | ||
</varlistentry> | ||
<varlistentry> | ||
<term><parameter>encoding</parameter></term> | ||
<listitem> | ||
<simpara> | ||
The string encoding. | ||
</simpara> | ||
</listitem> | ||
</varlistentry> | ||
</variablelist> | ||
</refsect1> | ||
|
||
<refsect1 role="returnvalues"> | ||
&reftitle.returnvalues; | ||
<simpara> | ||
Returns the resulting string. | ||
</simpara> | ||
</refsect1> | ||
|
||
<refsect1 role="seealso"> | ||
&reftitle.seealso; | ||
<simplelist> | ||
<member><function>mb_ucfirst</function></member> | ||
<member><function>lcfirst</function></member> | ||
</simplelist> | ||
</refsect1> | ||
|
||
</refentry> | ||
<!-- Keep this comment at the end of the file | ||
Local variables: | ||
mode: sgml | ||
sgml-omittag:t | ||
sgml-shorttag:t | ||
sgml-minimize-attributes:nil | ||
sgml-always-quote-attributes:t | ||
sgml-indent-step:1 | ||
sgml-indent-data:t | ||
indent-tabs-mode:nil | ||
sgml-parent-document:nil | ||
sgml-default-dtd-file:"~/.phpdoc/manual.ced" | ||
sgml-exposed-tags:nil | ||
sgml-local-catalogs:nil | ||
sgml-local-ecat-files:nil | ||
End: | ||
vim600: syn=xml fen fdm=syntax fdl=2 si | ||
vim: et tw=78 syn=sgml | ||
vi: ts=1 sw=1 | ||
--> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<refentry xml:id="function.mb-ltrim" xmlns="http://docbook.org/ns/docbook"> | ||
<refnamediv> | ||
<refname>mb_ltrim</refname> | ||
<refpurpose>Strip whitespace (or other characters) from the beginning of a string</refpurpose> | ||
</refnamediv> | ||
|
||
<refsect1 role="description"> | ||
&reftitle.description; | ||
<methodsynopsis> | ||
<type>string</type><methodname>mb_ltrim</methodname> | ||
<methodparam><type>string</type><parameter>string</parameter></methodparam> | ||
<methodparam choice="opt"><type>string</type><parameter>characters</parameter><initializer>&null;</initializer></methodparam> | ||
<methodparam choice="opt"><type>string</type><parameter>encoding</parameter><initializer>&null;</initializer></methodparam> | ||
</methodsynopsis> | ||
<simpara> | ||
Performs a multi-byte safe <function>ltrim</function> operation. | ||
Strip whitespace (or other characters) from the beginning of a string. | ||
</simpara> | ||
<simpara> | ||
Without the second parameter, | ||
<function>mb_ltrim</function> will strip these characters: | ||
</simpara> | ||
&strings.stripped.characters; | ||
</refsect1> | ||
|
||
<refsect1 role="parameters"> | ||
&reftitle.parameters; | ||
<variablelist> | ||
<varlistentry> | ||
<term><parameter>string</parameter></term> | ||
<listitem> | ||
<simpara> | ||
The input string. | ||
</simpara> | ||
</listitem> | ||
</varlistentry> | ||
<varlistentry> | ||
<term><parameter>characters</parameter></term> | ||
<listitem> | ||
&strings.parameter.characters.optional; | ||
</listitem> | ||
</varlistentry> | ||
<varlistentry> | ||
<term><parameter>encoding</parameter></term> | ||
<listitem> | ||
<simpara> | ||
The string encoding. | ||
</simpara> | ||
</listitem> | ||
</varlistentry> | ||
</variablelist> | ||
</refsect1> | ||
|
||
<refsect1 role="returnvalues"> | ||
&reftitle.returnvalues; | ||
<simpara> | ||
This function returns a string with whitespace stripped from the | ||
beginning of <parameter>string</parameter>. | ||
</simpara> | ||
</refsect1> | ||
|
||
<refsect1 role="seealso"> | ||
&reftitle.seealso; | ||
<simplelist> | ||
<member><function>mb_trim</function></member> | ||
<member><function>mb_rtrim</function></member> | ||
<member><function>ltrim</function></member> | ||
</simplelist> | ||
</refsect1> | ||
|
||
</refentry> | ||
<!-- Keep this comment at the end of the file | ||
Local variables: | ||
mode: sgml | ||
sgml-omittag:t | ||
sgml-shorttag:t | ||
sgml-minimize-attributes:nil | ||
sgml-always-quote-attributes:t | ||
sgml-indent-step:1 | ||
sgml-indent-data:t | ||
indent-tabs-mode:nil | ||
sgml-parent-document:nil | ||
sgml-default-dtd-file:"~/.phpdoc/manual.ced" | ||
sgml-exposed-tags:nil | ||
sgml-local-catalogs:nil | ||
sgml-local-ecat-files:nil | ||
End: | ||
vim600: syn=xml fen fdm=syntax fdl=2 si | ||
vim: et tw=78 syn=sgml | ||
vi: ts=1 sw=1 | ||
--> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<refentry xml:id="function.mb-rtrim" xmlns="http://docbook.org/ns/docbook"> | ||
<refnamediv> | ||
<refname>mb_rtrim</refname> | ||
<refpurpose>Strip whitespace (or other characters) from the end of a string</refpurpose> | ||
</refnamediv> | ||
|
||
<refsect1 role="description"> | ||
&reftitle.description; | ||
<methodsynopsis> | ||
<type>string</type><methodname>mb_rtrim</methodname> | ||
<methodparam><type>string</type><parameter>string</parameter></methodparam> | ||
<methodparam choice="opt"><type>string</type><parameter>characters</parameter><initializer>&null;</initializer></methodparam> | ||
<methodparam choice="opt"><type>string</type><parameter>encoding</parameter><initializer>&null;</initializer></methodparam> | ||
</methodsynopsis> | ||
<simpara> | ||
Performs a multi-byte safe <function>rtrim</function> operation, | ||
and returns a string with whitespace (or other characters) stripped from the | ||
end of <parameter>string</parameter>. | ||
</simpara> | ||
<simpara> | ||
Without the second parameter, | ||
<function>rtrim</function> will strip these characters: | ||
</simpara> | ||
&strings.stripped.characters; | ||
</refsect1> | ||
|
||
<refsect1 role="parameters"> | ||
&reftitle.parameters; | ||
<variablelist> | ||
<varlistentry> | ||
<term><parameter>string</parameter></term> | ||
<listitem> | ||
<para> | ||
The input string. | ||
</para> | ||
saundefined marked this conversation as resolved.
Show resolved
Hide resolved
|
||
</listitem> | ||
</varlistentry> | ||
<varlistentry> | ||
<term><parameter>characters</parameter></term> | ||
<listitem> | ||
&strings.parameter.characters.optional; | ||
</listitem> | ||
</varlistentry> | ||
<varlistentry> | ||
<term><parameter>encoding</parameter></term> | ||
<listitem> | ||
<simpara> | ||
The string encoding. | ||
</simpara> | ||
</listitem> | ||
</varlistentry> | ||
</variablelist> | ||
</refsect1> | ||
|
||
<refsect1 role="returnvalues"> | ||
&reftitle.returnvalues; | ||
<simpara> | ||
Returns the modified string. | ||
</simpara> | ||
</refsect1> | ||
|
||
<refsect1 role="seealso"> | ||
&reftitle.seealso; | ||
<simplelist> | ||
<member><function>mb_trim</function></member> | ||
<member><function>mb_ltrim</function></member> | ||
<member><function>rtrim</function></member> | ||
</simplelist> | ||
</refsect1> | ||
|
||
</refentry> | ||
<!-- Keep this comment at the end of the file | ||
Local variables: | ||
mode: sgml | ||
sgml-omittag:t | ||
sgml-shorttag:t | ||
sgml-minimize-attributes:nil | ||
sgml-always-quote-attributes:t | ||
sgml-indent-step:1 | ||
sgml-indent-data:t | ||
indent-tabs-mode:nil | ||
sgml-parent-document:nil | ||
sgml-default-dtd-file:"~/.phpdoc/manual.ced" | ||
sgml-exposed-tags:nil | ||
sgml-local-catalogs:nil | ||
sgml-local-ecat-files:nil | ||
End: | ||
vim600: syn=xml fen fdm=syntax fdl=2 si | ||
vim: et tw=78 syn=sgml | ||
vi: ts=1 sw=1 | ||
--> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.