Skip to content

Commit 8642816

Browse files
committed
Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3: reverted changes for #62477
2 parents be8f089 + ad7eeba commit 8642816

File tree

4 files changed

+2
-45
lines changed

4 files changed

+2
-45
lines changed

ext/spl/spl_iterators.c

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1382,31 +1382,12 @@ static spl_dual_it_object* spl_dual_it_construct(INTERNAL_FUNCTION_PARAMETERS, z
13821382
intern->dit_type = dit_type;
13831383
switch (dit_type) {
13841384
case DIT_LimitIterator: {
1385-
zval *tmp_offset, *tmp_count;
13861385
intern->u.limit.offset = 0; /* start at beginning */
13871386
intern->u.limit.count = -1; /* get all */
1388-
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O|zz", &zobject, ce_inner, &tmp_offset, &tmp_count) == FAILURE) {
1387+
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O|ll", &zobject, ce_inner, &intern->u.limit.offset, &intern->u.limit.count) == FAILURE) {
13891388
zend_restore_error_handling(&error_handling TSRMLS_CC);
13901389
return NULL;
13911390
}
1392-
if (tmp_offset && Z_TYPE_P(tmp_offset) != IS_NULL) {
1393-
if (Z_TYPE_P(tmp_offset) != IS_LONG) {
1394-
zend_throw_exception(spl_ce_OutOfRangeException, "offset param must be of type int", 0 TSRMLS_CC);
1395-
zend_restore_error_handling(&error_handling TSRMLS_CC);
1396-
return NULL;
1397-
} else {
1398-
intern->u.limit.offset = Z_LVAL_P(tmp_offset);
1399-
}
1400-
}
1401-
if (tmp_count && Z_TYPE_P(tmp_count) != IS_NULL) {
1402-
if (Z_TYPE_P(tmp_count) != IS_LONG) {
1403-
zend_throw_exception(spl_ce_OutOfRangeException, "count param must be of type int", 0 TSRMLS_CC);
1404-
zend_restore_error_handling(&error_handling TSRMLS_CC);
1405-
return NULL;
1406-
} else {
1407-
intern->u.limit.count = Z_LVAL_P(tmp_count);
1408-
}
1409-
}
14101391
if (intern->u.limit.offset < 0) {
14111392
zend_throw_exception(spl_ce_OutOfRangeException, "Parameter offset must be >= 0", 0 TSRMLS_CC);
14121393
zend_restore_error_handling(&error_handling TSRMLS_CC);

ext/spl/spl_iterators.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ typedef struct _spl_dual_it_object {
137137
uint str_key_len;
138138
ulong int_key;
139139
int key_type; /* HASH_KEY_IS_STRING or HASH_KEY_IS_LONG */
140-
long pos;
140+
int pos;
141141
} current;
142142
dual_it_type dit_type;
143143
union {

ext/spl/tests/bug62477_1.phpt

Lines changed: 0 additions & 12 deletions
This file was deleted.

ext/spl/tests/bug62477_2.phpt

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)