Re: [RFC] Add is_list(mixed $value): bool to check for list-like arrays
| From: | Ben Ramsey | Date: | Wed, 23 Dec 2020 17:44:03 +0000 |
| Subject: | Re: [RFC] Add is_list(mixed $value): bool to check for list-like arrays | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-112611@lists.php.net to get a copy of this message | ||
> On Dec 22, 2020, at 15:39, Josh Bruce <josh@joshbruce.dev> wrote:
>
>>> tl;dr: Could add flags to is_array.
>>
>> Please, no.
>>
>> PHP needs fewer flags, not more.
>>
>> -Mike
>
> lol - There’s something to be said for that.
>
> Thinking of “simple" bridges that can be built toward a possible larger
> discussion around naming and defining things and not adding more to the
> SL related to arrays until then while getting the capability…cause that
> part of the SL is pretty large. :)
I actually like the idea of flags added to
Attachment: [application/pgp-signature] Message signed with OpenPGP signature.asc
is_array() for this.
Something like:
is_array($value, ZERO_INDEXED | ASSOCIATIVE | INTEGER_INDEXED)
I’m not suggesting these names; they’re for illustration only.
Cheers,
Ben
Attachment: [application/pgp-signature] Message signed with OpenPGP signature.asc