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

Replace the array_merge with spread array operator #1111

Merged
merged 1 commit into from Oct 3, 2023

Conversation

peter279k
Copy link
Contributor

@peter279k peter279k commented Oct 3, 2023

Q A
Branch v2.x
Bug fix? no
New feature? no
BC breaks? no
Deprecations? no
Documented? no
Fixed tickets comma-separated list of tickets fixed by the PR, if any
  • According to the reference, it's great to use the spread array operator to replace the array_merge function.
  • There're two reasons about using the spread array operator:
    • Spread operator should have a better performance than array_merge and compile time optimization can be performant for constant arrays.
    • array_merge only supports array, while the spread operator also supports objects implementing Traversable.

New Task Checklist:

  • Are the dependencies added to the composer.json suggestions?
  • Is the doc/tasks.md file updated?
  • Are the task parameters documented?
  • Is the task registered in the tasks.yml file?
  • Does the task contains phpunit tests?
  • Is the configuration having logical allowed types?
  • Does the task run in the correct context?
  • Is the run() method readable?
  • Is the run() method using the configuration correctly?
  • Are all CI services returning green?

@veewee veewee added this to the 2.2.0 milestone Oct 3, 2023
@veewee veewee merged commit 966bf77 into phpro:v2.x Oct 3, 2023
10 checks passed
@veewee
Copy link
Contributor

veewee commented Oct 3, 2023

Thanks

@peter279k peter279k deleted the apply_array_spread branch October 3, 2023 11:57
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

2 participants