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

Nested List_ #321

Closed
ondrejmirtes opened this issue Nov 30, 2016 · 2 comments
Closed

Nested List_ #321

ondrejmirtes opened this issue Nov 30, 2016 · 2 comments

Comments

@ondrejmirtes
Copy link
Contributor

First of all, I really want to thank you for continuing working on PHP-Parser! It's been a really useful tool for several of my projects.

I just tried out 3.0.0 and found probably a bug with new handling of List_. Take this example (https://3v4l.org/8TeXR):

$someArray = ['foo', 'bar', 'ipsum', ['baz', 'dolor']];
list($listedOne, , $listedTwo['two'], list($listedThree, $listedFour['four'])) = $someArray;

There's a nested list() calls. I'd expect the first top list() to contain array of ArrayItems, but mine contains in this case:

ArrayItem
NULL (expected, but not said in the typehint of List_::$items)
ArrayItem
List_

I'd expect them to all be ArrayItem. In the case of the nested List_, I'd like to be an ArrayItem with List_ in its $value property.

@nikic
Copy link
Owner

nikic commented Dec 1, 2016

Thanks for catching this so quickly! Fixed in 3e158a2 and released as v3.0.1.

@nikic nikic closed this as completed Dec 1, 2016
@ondrejmirtes
Copy link
Contributor Author

@nikic By the way, this is the project I use PHP-Parser on: https://medium.com/@ondrejmirtes/phpstan-2939cd0ad0e3 (https://github.com/phpstan/phpstan) :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants