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

Iterating class implementing ArrayAccess with {foreach} #332

Closed
chmeldax opened this issue Jan 31, 2017 · 1 comment
Closed

Iterating class implementing ArrayAccess with {foreach} #332

chmeldax opened this issue Jan 31, 2017 · 1 comment

Comments

@chmeldax
Copy link

Hello,

it seems to me that the change introduced in 21aa211 prevents some certain classes implementing ArrayAccess from being iterated with foreach macro.

The condition in 21aa211#diff-6b401ee81e7ad91e8e4fb5f199bc6a3eR129 does not take into account classes that implement ArrayAccess but do not use numerical offsets.

Consequently, theinit() method then returns NULL and the iteration is not performed at all.

@uwetews
Copy link
Contributor

uwetews commented May 21, 2017

Please note that a class implements ArrayAccess does not necessary mean that it can be iterated by foreach.

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