Simplify string function classification and move locale discussion to a separate paragraph
Nobody has claimed this yet.
- Dominant language
- XML
- Stars
- 596
- Forks
- 890
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 55
Description
Problem
Page:
https://www.php.net/manual/en/language.types.string.php
Section: "Details of the String Type"
The current section classifies string functions into several categories, including byte-oriented, encoding-aware, locale-dependent, and UTF-8-assuming functions.
However, this mixes different concerns:
- how strings are interpreted (bytes, encodings, Unicode)
- how behavior may vary (locale)
This makes it harder to understand how to correctly handle UTF-8 strings.
In addition, the documentation does not clearly state that the mbstring extension supports UTF-8, and the distinction between mbstring and intl is unclear.
Proposal
Simplify the classification to focus on how strings are interpreted, and move the locale discussion into a separate paragraph.
For example:
String functions in PHP can be broadly categorized based on how they interpret string data:
- Byte-oriented functions operate on strings as raw sequences of bytes.
- Encoding-aware functions interpret strings according to a specified encoding, such as UTF-8. The mbstring extension provides such functions and supports UTF-8 and other multibyte encodings.
- Unicode-aware functions assume UTF-8 and provide higher-level operations. These are primarily provided by the intl extension.
Then describe locale separately:
Some operations may be locale-dependent.
Historically, certain functions relied on the system locale (setlocale), but this behavior is being reduced.
For locale-aware operations based on Unicode, the intl extension provides explicit support using ICU.
Reference: https://wiki.php.net/rfc/strtolower-ascii
Rationale
- separates string interpretation from locale concerns
- makes UTF-8 support in mbstring explicit
- clarifies the role of mbstring vs intl
- improves readability and reduces confusion for users working with UTF-8
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Open the linked PHP manual page and read the “Details of the String Type” section, then review the referenced strtolower-ascii RFC. Simplify the classification around byte, encoding, and Unicode interpretation, move locale behavior into its own paragraph, and make mbstring’s UTF-8 support and its distinction from intl clear.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 65/100