}
if ($start >= 0 && $length >= 0) {
- return iterator_to_array(new LimitIterator($item, $start, $length), $preserveKeys);
+ return iterator_to_array(new LimitIterator($item, $start, $length === null ? -1 : $length), $preserveKeys);
}
$item = iterator_to_array($item, $preserveKeys);
{{ '1234'|slice(1) }}
{{ '1234'[1:] }}
{{ '1234'[:1] }}
+
+{{ arr|slice(3)|join('') }}
+{{ arr[2:]|join('') }}
--DATA--
return array('start' => 1, 'length' => 2, 'arr' => new ArrayObject(array(1, 2, 3, 4)))
--EXPECT--
234
234
1
+
+4
+34
\ No newline at end of file