php / php/doc-en

mb_strwidth behavior changed

Open Beginner friendly
#1,778 3 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Extension: mbstring
Dominant language
XML
Stars
596
Forks
890
Avg merge
1d 15h
Merged PRs (30d)
55

Description

Due to this commit, the documentation for mb_strwidth should be changed: https://github.com/php/php-src/commit/d8c785b894e1a4ed9793d71cad02330cb0034faa?

This function now returns the proper width of a multibyte string starting with php 8.1. For example:

For php <= 8.0:

echo mb_strwidth('🏆');

returns: 1

For php >= 8.1:

echo mb_strwidth('🏆');

returns: 2

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the linked PHP commit and the existing mb_strwidth documentation entry. Update the documentation to explain that the function returns the proper multibyte string width from PHP 8.1, including the version-specific 🏆 example and results. Done means the documented behavior matches PHP versions before and from 8.1.

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
Mostly clear
Newbie friendliness
62/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.