#54377 closed feature request (fixed)
Introduce new PHP cross-version compatibility functions, `str_ends_with()`
Reported by: | pbiron | Owned by: | hellofromTonya |
---|---|---|---|
Milestone: | 5.9 | Priority: | normal |
Severity: | normal | Version: | |
Component: | General | Keywords: | php8 has-patch has-unit-tests commit |
Focuses: | Cc: |
Description
PHP 8 added a str_ends_with() function.
It would be good to add a polypill for it to core, so that plugins that use it will work on sites running PHP < 8.
I'll do a patch with unit tests tomorrow.
Change History (13)
This ticket was mentioned in Slack in #core-php by hellofromtonya. View the logs.
3 years ago
#5
@
3 years ago
Thanx @pbearne! (hi, by the way :-)
I was just coming to add a comment that I will also include a polyfill for str_starts_with()
as well.
This ticket was mentioned in PR #1811 on WordPress/wordpress-develop by pbearne.
3 years ago
#6
- Keywords has-patch has-unit-tests added; needs-patch needs-unit-tests removed
Trac ticket: https://core.trac.wordpress.org/ticket/54377
This ticket was mentioned in Slack in #core-php by pbearne. View the logs.
3 years ago
#8
@
3 years ago
@pbearne Thanx for the PR Paul. I just made a few comments/suggestions for corrections to it.
@hellofromTonya Would appreciate you also looking at those comments.
#9
@
3 years ago
- Keywords commit added
Thanks @pbiron for the ping. Did a thorough review. Ready for commit.
hellofromtonya commented on PR #1811:
3 years ago
#11
Committed via changeset https://core.trac.wordpress.org/changeset/52040.
#12
@
3 years ago
Thank you everyone for your contributions! These functions are now available for use in Core.
Accepting this feature as it can be bundled with the other PHP polyfills.