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

2020-12-23 Thread Bruce Weirdan
On Wed, Dec 23, 2020 at 7:44 PM Ben Ramsey wrote: > I actually like the idea of flags added to `is_array()` for this. > > Something like: > > is_array($value, ZERO_INDEXED | ASSOCIATIVE | INTEGER_INDEXED) > For static analysis, though, unary predicate (e.g. `is_list()`) is much easier to

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

2020-12-23 Thread Josh Bruce
> >> I actually like the idea of flags added to `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. > > I'm strongly opposed to adding any flags to is_array

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

2020-12-23 Thread tyson andre
Hi Ben, > I don’t think changing the name changes my concern, but as Tyson > pointed out: > > > These idiosyncrasies of php and unintuitive behaviors existed prior > > to this RFC. > > I’m generally +1 on this RFC, but as I think about it, maybe there is a > problem with the name. If we choose

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

2020-12-23 Thread tyson andre
Hi Ben/Josh, > I actually like the idea of flags added to `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. I'm strongly opposed to adding any flags to is_array -

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

2020-12-23 Thread Ben Ramsey
> On Dec 22, 2020, at 15:39, Josh Bruce 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 >

Re: [PHP-DEV] Re: Improving PRNG implementation.

2020-12-23 Thread zeriyoshi
Thanks tyson. > This would also make it easier to use those generators in brand new algorithms that weren't in the initial RFC. > (or in algorithms written by users in PHP) This suggestion seems to make sense. Maybe the RNG should only focus on generating random numbers and not anything else.

[PHP-DEV] [VOTE] Restrict $GLOBALS usage

2020-12-23 Thread Nikita Popov
Hi internals, As there was no further feedback, I've opened voting on https://wiki.php.net/rfc/restrict_globals_usage. The vote closes on 2021-01-06. Regards, Nikita