File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -3064,7 +3064,8 @@ static zend_result spl_iterator_zip_valid(zend_object_iterator *iter)
30643064{
30653065 spl_zip_iterator * zip_iterator = (spl_zip_iterator * ) iter ;
30663066
3067- for (uint32_t i = 0 ; i < zip_iterator -> iterator_count ; i ++ ) {
3067+ uint32_t i = 0 ;
3068+ for (; i < zip_iterator -> iterator_count ; i ++ ) {
30683069 spl_zip_iterator_entry * current = & zip_iterator -> iterators [i ];
30693070 if (spl_zip_iterator_is_obj_entry (current )) {
30703071 if (current -> obj_iter -> funcs -> valid (current -> obj_iter ) != SUCCESS ) {
@@ -3078,7 +3079,7 @@ static zend_result spl_iterator_zip_valid(zend_object_iterator *iter)
30783079 }
30793080 }
30803081
3081- return SUCCESS ;
3082+ return i > 0 ? SUCCESS : FAILURE ;
30823083}
30833084
30843085/* Invariant: returned array is packed and has all UNDEF elements. */
Original file line number Diff line number Diff line change @@ -3,6 +3,12 @@ iterator_zip
33--FILE--
44<?php
55
6+ foreach (iterator_zip () as $ _ ) {} // FIXME
7+
8+ foreach (iterator_zip ([]) as $ x ) {
9+ var_dump ($ x );
10+ }
11+
612$ a = [1 , 2 , 3 ];
713$ b = [4 , 5 , 6 ];
814
You can’t perform that action at this time.
0 commit comments