On Tue, Jul 17, 2018 at 2:11 PM, Levi Morrison <le...@php.net> wrote:

> And another: `$length` is a length when it's a positive number, but
> it's an offset from the end when it's negative.
>

That's how substr() works, so it's at least consistent with that.

It makes a lot more sense if you think of it as
$array->drop($offset)->take($length), where both ->drop() and ->take() add
the array's length if the argument is negative.

Reply via email to