Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Unpack nested array instead of using temp var #15506

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

Closed
wants to merge 2 commits into from
Closed

Unpack nested array instead of using temp var #15506

wants to merge 2 commits into from

Conversation

dosten
Copy link
Contributor

@dosten dosten commented Aug 11, 2015

Q A
Bug fix? no
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
License MIT

Since php 5.5 we can unpack nested arrays with list() to avoid temp vars.

@jakzal
Copy link
Contributor

jakzal commented Aug 11, 2015

Status: Reviewed

@nicolas-grekas
Copy link
Member

@dosten Did you check if there are other occurrences of this in the code?

@dosten dosten changed the title [DependencyInjection] Unpack nested array instead of using temp var Unpack nested array instead of using temp var Aug 11, 2015
@dosten
Copy link
Contributor Author

dosten commented Aug 11, 2015

@nicolas-grekas Done! but the failing tests in PHP7 seems to be not related.

@nicolas-grekas
Copy link
Member

👍

1 similar comment
@jakzal
Copy link
Contributor

jakzal commented Aug 11, 2015

👍

@dosten
Copy link
Contributor Author

dosten commented Aug 11, 2015

Thanks for run the test suite again :)

@fabpot
Copy link
Member

fabpot commented Aug 11, 2015

Thank you @dosten.

@fabpot fabpot closed this Aug 11, 2015
fabpot added a commit that referenced this pull request Aug 11, 2015
This PR was squashed before being merged into the 3.0-dev branch (closes #15506).

Discussion
----------

Unpack nested array instead of using temp var

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| License       | MIT

Since php 5.5 we can [unpack nested arrays with `list()`](http://php.net/manual/en/control-structures.foreach.php#control-structures.foreach.list) to avoid temp vars.

Commits
-------

20e9ed6 Unpack nested array instead of using temp var
@dosten dosten deleted the dependency-injection/improved-code branch August 11, 2015 21:06
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.

5 participants