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

Fix GH-8924 str_split of empty string must return empty array #8945

Closed
wants to merge 1 commit into from

Conversation

mvorisek
Copy link
Contributor

@mvorisek mvorisek commented Jul 7, 2022

The inconsistency was introduced in 0818fae by a mistake as found out by @emkey08.

mb_str_split behaves properly and empty input is covered by a test already.

As some algorithms might rely on the bad - always non-empty array - behaviour, targetting master only.

@mvorisek mvorisek marked this pull request as ready for review July 7, 2022 08:25
Copy link
Contributor

@cmb69 cmb69 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the PR! In my opinion, this is okay for master.

ext/standard/string.c Outdated Show resolved Hide resolved
Co-authored-by: Christoph M. Becker <cmbecker69@gmx.de>
@devnexen
Copy link
Member

devnexen commented Jul 8, 2022

Should the change be documented ?

@cmb69
Copy link
Contributor

cmb69 commented Jul 8, 2022

Should the change be documented ?

Besides the usual entry in NEWS, there should be a brief note in UPGRADING, so that the doc team can later put that into the migration guide.

@devnexen devnexen closed this in e809254 Jul 8, 2022
@mvorisek mvorisek deleted the fix_str_split branch July 8, 2022 16:54
iluuu1994 added a commit to iluuu1994/php-src that referenced this pull request Jul 14, 2022
Introduced in phpGH-8945

With RETURN_EMPTY_ARRAY this function can now return an interned array which
has refcount 2.
iluuu1994 added a commit that referenced this pull request Jul 15, 2022
Introduced in GH-8945

With RETURN_EMPTY_ARRAY this function can now return an interned array which
has refcount 2.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants