Update the array_is_list compat function, add tests#6028
Update the array_is_list compat function, add tests#6028swissspidy wants to merge 4 commits intoWordPress:trunkfrom
array_is_list compat function, add tests#6028Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Core SVNIf you're a Core Committer, use this list when committing to GitHub Merge commitsIf you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
costdev
left a comment
There was a problem hiding this comment.
Thanks for putting the PR together @swissspidy!
I'm happy to go with the shorter function contents, though I haven't had a chance to compare both approaches on large arrays. It would be good to get some benchmarks on that if possible, but not a blocker.
LGTM 👍
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
|
Okay so the shorter version fails for the Benchmarking with a larger array now. Turns out the For the unhappy path the performance seems equal, see https://3v4l.org/5YMl2/perf (foreach), https://3v4l.org/o1SSY/perf ( So that appears to make a case for using both as Symfony does. |
|
Not sure how both can ever be run though. If |
|
@costdev It's specifically that the output for using |
|
Tests committed in https://core.trac.wordpress.org/changeset/57535 |
The function was polyfilled via another ticket.
This adds tests that were originally added and simplifies the polyfill (assuming the tests still pass)
Trac ticket: https://core.trac.wordpress.org/ticket/55105
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.