Skip to content
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

[PHP 8.4] mb_trim, mb_ltrim, and mb_rtrim polyfills #458

Open
Ayesh opened this issue Jan 10, 2024 · 1 comment · May be fixed by #469
Open

[PHP 8.4] mb_trim, mb_ltrim, and mb_rtrim polyfills #458

Ayesh opened this issue Jan 10, 2024 · 1 comment · May be fixed by #469

Comments

@Ayesh
Copy link
Contributor

Ayesh commented Jan 10, 2024

RFC: Multibyte for trim function mb_trim, mb_ltrim and mb_rtrim
php.net: TBD
PHP.Watch: PHP 8.4: Mbstring: New mb_trim, mb_ltrim, and mb_rtrim functions

I think we can provide a polyfill for these functions. I created a small repo here with sample code that passes the test suite in php-src for this function. I'll happily submit a PR with it if you think that approach is good enough.

Thank you.

@stof
Copy link
Member

stof commented Jan 10, 2024

PRs are happily accepted.

This should be added in 2 places:

  • in the mbstring polyfill
  • in the php 8.4 polyfill (which needs to be created as it does not exist yet), but only when mbstring is available (see how mb_str_split is handled in the PHP 7.4 polyfill)

Ayesh added a commit to Ayesh/polyfill that referenced this issue Jan 10, 2024
 - Adds PHP 8.4 polyfill for splits
 - Enables PHP 8.4 in GitHub Actions tests

This is also to prepare for symfony#458 to add new `mb_trim`, `mb_ltrim`, and `mb_rtrim` functions, which will be a separate PR.
Ayesh added a commit to Ayesh/polyfill that referenced this issue Jan 10, 2024
 - Adds PHP 8.4 polyfill for splits
 - Enables PHP 8.4 in GitHub Actions tests

This is also to prepare for symfony#458 to add new `mb_trim`, `mb_ltrim`, and `mb_rtrim` functions, which will be a separate PR.
nicolas-grekas pushed a commit to Ayesh/polyfill that referenced this issue Jan 29, 2024
 - Adds PHP 8.4 polyfill for splits
 - Enables PHP 8.4 in GitHub Actions tests

This is also to prepare for symfony#458 to add new `mb_trim`, `mb_ltrim`, and `mb_rtrim` functions, which will be a separate PR.
nicolas-grekas added a commit that referenced this issue Jan 29, 2024
This PR was merged into the 1.x branch.

Discussion
----------

[PHP 8.4] Add initial stubs

 - Adds PHP 8.4 polyfill for splits
 - Enables PHP 8.4 in GitHub Actions tests

This is also to prepare for #458 to add new `mb_trim`, `mb_ltrim`, and `mb_rtrim` functions, which will be a separate PR.

Commits
-------

8cb84ad [PHP 8.4] Add initial stubs
@Fan2Shrek Fan2Shrek linked a pull request Mar 30, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants