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

[php] Implement native iterator on arrays #8821

Merged
merged 4 commits into from
Sep 18, 2019

Conversation

benmerckx
Copy link
Contributor

This one implements php's Iterator on arrays using the internal array position. It eases interfacing with generated haxe code from the php side. (Eg. allows us to foreach ($anyHaxeArray as $key => $item)).

@RealyUniqueName
Copy link
Member

RealyUniqueName commented Sep 17, 2019

Haxe's Array should implement Php's IteratorAggregate instead of Iterator, then this would be possible:

foreach($haxeArray as $key => $value) {
    foreach($haxeArray as $key2 => $value2) {
    }
}

@RealyUniqueName RealyUniqueName added the platform-php Everything related to PHP label Sep 17, 2019
std/php/ArrayIterator.hx Outdated Show resolved Hide resolved
@RealyUniqueName RealyUniqueName merged commit 7a2256f into HaxeFoundation:development Sep 18, 2019
@skial skial mentioned this pull request Sep 18, 2019
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform-php Everything related to PHP
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants