Index: array.c =================================================================== RCS file: /repository/php-src/ext/standard/array.c,v retrieving revision 1.308.2.21.2.37.2.19 diff -u -r1.308.2.21.2.37.2.19 array.c --- array.c 29 Jan 2008 10:45:06 -0000 1.308.2.21.2.37.2.19 +++ array.c 5 Feb 2008 00:36:02 -0000 @@ -2113,24 +2113,20 @@ zend_bool preserve_keys = 0; /* Whether to preserve keys while copying to the new array or not */ int num_in, /* Number of elements in the input array */ pos; /* Current position in the array */ - zval *z_length; char *string_key; uint string_key_len; ulong num_key; HashPosition hpos; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "al|z/b", &input, &offset, &z_length, &preserve_keys) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "al|lb", &input, &offset, &length, &preserve_keys) == FAILURE) { return; } /* Get number of entries in the input hash */ num_in = zend_hash_num_elements(Z_ARRVAL_P(input)); - /* We want all entries from offset to the end if length is not passed or is null */ - if (ZEND_NUM_ARGS() >= 3 && Z_TYPE_P(z_length) != IS_NULL) { - convert_to_long(z_length); - length = Z_LVAL_P(z_length); - } else { + /* We want all entries from offset to the end if length is not passed or is 0 */ + if (!length) { length = num_in; }