Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions src/php/handlers/php_seq_handlers.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,18 @@ static void php_ds_seq_unset_dimension
ds_seq_separate(&php_obj->seq);
ds_seq_t *seq = php_obj->seq;
zend_long index = 0;
bool is_null = false;
ZVAL_DEREF(offset);

if (Z_TYPE_P(offset) == IS_LONG) {
index = Z_LVAL_P(offset);

} else {
if (zend_parse_parameter(ZEND_PARSE_PARAMS_QUIET, 1, offset, "l", &index) == FAILURE) {
return;
}
} else if (Z_TYPE_P(offset) == IS_NULL) {
index = 0;
php_docref_error(E_DEPRECATED, "Using null as array offset is deprecated");
} else if (!zend_parse_arg_long(offset, &index, &is_null, false, 0) {
INTEGER_INDEX_REQUIRED(z);
return;
}

if (ds_seq_index_exists(seq, index)) {
Expand Down