Fixed a bug in array_shift/array_pop.
limit_val--;
}
else { /* if no match */
- /* Add the last piece to the return value, if there
- were matches before */
- if (piece > subject->value.str.val)
+ /* Add the last piece to the return value, if there is
+ something left */
+ if (limit != 0)
add_next_index_stringl(return_value,
piece,
subject_end-piece, 1);
zend_error(E_WARNING, "The argument needs to be an array");
return;
}
-
+
+ if (zend_hash_num_elements(stack->value.ht) == 0) {
+ return;
+ }
+
/* Get the first or last value and copy it into the return value */
if (off_the_end)
zend_hash_internal_pointer_end(stack->value.ht);