mirror of
https://github.com/php/php-src.git
synced 2024-09-24 11:27:28 +00:00
this is integer, not pointer
This commit is contained in:
parent
d659ce7a0c
commit
1d540b4255
@ -2296,7 +2296,7 @@ PHP_FUNCTION(array_slice)
|
|||||||
zval *input, /* Input array */
|
zval *input, /* Input array */
|
||||||
**entry; /* An array entry */
|
**entry; /* An array entry */
|
||||||
long offset, /* Offset to get elements from */
|
long offset, /* Offset to get elements from */
|
||||||
length = NULL;
|
length = 0;
|
||||||
zend_bool preserve_keys = 0; /* Whether to preserve keys while copying to the new array or not */
|
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 */
|
int num_in, /* Number of elements in the input array */
|
||||||
pos; /* Current position in the array */
|
pos; /* Current position in the array */
|
||||||
@ -2313,7 +2313,7 @@ PHP_FUNCTION(array_slice)
|
|||||||
num_in = zend_hash_num_elements(Z_ARRVAL_P(input));
|
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 length is null */
|
/* We want all entries from offset to the end if length is not passed or length is null */
|
||||||
if (length == NULL) {
|
if (length == 0) {
|
||||||
length = num_in;
|
length = num_in;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user