Re: [PHP-DEV] Re: [RFC] Add is_list(mixed $value): bool to check for list-like arrays

2021-01-04 Thread Theodore Brown
On Sun, Jan 3, 2021 at 8:56 PM Larry Garfield wrote: > On Sun, Jan 3, 2021, at 12:17 PM, tyson andre wrote: > > > I've created the RFC https://wiki.php.net/rfc/is_list > > > > > > This adds a new function `is_list(mixed $value): bool` that will > > > return true if the type of $value is array

Re: [PHP-DEV] Re: [RFC] Add is_list(mixed $value): bool to check for list-like arrays

2021-01-03 Thread Larry Garfield
On Sun, Jan 3, 2021, at 12:17 PM, tyson andre wrote: > Hi internals, > > > I've created the RFC https://wiki.php.net/rfc/is_list > > > > This adds a new function `is_list(mixed $value): bool` that will return true > > if the type of $value is array and the array keys are `0 .. > >

[PHP-DEV] Re: [RFC] Add is_list(mixed $value): bool to check for list-like arrays

2021-01-03 Thread tyson andre
Hi internals, > I've created the RFC https://wiki.php.net/rfc/is_list > > This adds a new function `is_list(mixed $value): bool` that will return true > if the type of $value is array and the array keys are `0 .. count($value)-1` > in that order. > > It's well-known that PHP's `array` data type