Re: [PHP-DEV] Straw poll: Naming for `*any()` and `*all()` on iterables

2020-12-21 Thread Pierre
Le 22/12/2020 à 01:48, tyson andre a écrit : Hi Sara Golemon, This is probably going to be a terrible idea because it involves a little magic but... "iterable" is already a forbidden userspace class name since it's reserved for the psuedo-type which is a union of `Traversable | array`. What

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

2020-12-21 Thread Ben Ramsey
> On Dec 21, 2020, at 16:15, Mike Schinkel wrote: > >> On Dec 20, 2020, at 9:09 PM, Ben Ramsey wrote: >> >>> On Dec 19, 2020, at 19:43, tyson andre >>> wrote: >>> >>> It can be useful to verify that the assumption that array keys are >>> consecutive integers is correct, both for data that is

Re: [PHP-DEV] [RFC] Fibers

2020-12-21 Thread Mike Schinkel
> On Dec 21, 2020, at 6:53 PM, Aaron Piotrowski wrote: > >> On Dec 21, 2020, at 4:33 PM, Mike Schinkel > > wrote: >> >>> On Dec 17, 2020, at 11:30 AM, Aaron Piotrowski >> > wrote: >>> >>> Hello everyone! >>> >>> I would like to introduce an

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

2020-12-21 Thread tyson andre
Hi Ben, > I think there are some places where `is_list()` could be unintuitive to > those who don’t understand some of the idiosyncrasies of PHP. > > For example, with > >     $a = ['foo', 'bar', 'baz’]; > > `is_list()` will return `true`, but if you run `$a` through `asort()`, > `is_list()` wi

Re: [PHP-DEV] Straw poll: Naming for `*any()` and `*all()` on iterables

2020-12-21 Thread tyson andre
Hi Sara Golemon, > This is probably going to be a terrible idea because it involves a little > magic but... > > "iterable" is already a forbidden userspace class name since it's reserved > for the psuedo-type which is a union of `Traversable | array`. > > What if we went ahead and defined an act

Re: [PHP-DEV] [RFC] Fibers

2020-12-21 Thread tyson andre
Hi Mike Schinkel, > This is interesting, and potentially very useful. >  > I am curious about how you propose access to shared memory across fibers?  > What will happen if two fibers try to update a $GLOBALS variable at the same > time?  Or a property of the same object?  How will developers man

Re: [PHP-DEV] [RFC] Fibers

2020-12-21 Thread Aaron Piotrowski
> On Dec 21, 2020, at 4:33 PM, Mike Schinkel wrote: > >> On Dec 17, 2020, at 11:30 AM, Aaron Piotrowski wrote: >> >> Hello everyone! >> >> I would like to introduce an RFC for adding full-stack fibers to PHP: >> https://wiki.php.net/rfc/fibers >> >> Fibers are primarily used to implement gr

Re: [PHP-DEV] [RFC] Fibers

2020-12-21 Thread Mike Schinkel
> On Dec 17, 2020, at 11:30 AM, Aaron Piotrowski wrote: > > Hello everyone! > > I would like to introduce an RFC for adding full-stack fibers to PHP: > https://wiki.php.net/rfc/fibers > > Fibers are primarily used to implement green-threads or coroutines for > asynchronous I/O. Fibers are sim

Re: [PHP-DEV] [RFC] Short-match

2020-12-21 Thread Mike Schinkel
> On Dec 16, 2020, at 12:49 PM, Ben Ramsey wrote: > >> On Dec 16, 2020, at 10:54, Mike Schinkel wrote: >> >> If we allow "switch {...}" to represent "switch (true){...}" then the value >> switch compares will be hidden and less obvious to a developer if they are >> forgetting to consider

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

2020-12-21 Thread Mike Schinkel
> On Dec 20, 2020, at 9:09 PM, Ben Ramsey wrote: > >> On Dec 19, 2020, at 19:43, tyson andre >> wrote: >> >> It can be useful to verify that the assumption that array keys are >> consecutive integers is correct, both for data that is being passed >> into a module or for validating data before r

Re: [PHP-DEV] Follow up on Octal literal RFC

2020-12-21 Thread G. P. B.
On Mon, 21 Dec 2020 at 19:36, G. P. B. wrote: > Now, onto the weird special case, which looks like a bug in the > implementation of base_convert() as > var_dump(base_convert('O', 8, 10)); > Will emit the following deprecation warning (but only if the starting base > is 8): > Deprecated: Invalid c

[PHP-DEV] Follow up on Octal literal RFC

2020-12-21 Thread G. P. B.
Hello internals, The implementation for the RFC still hasn't landed due to some helpful remarks made by Tyson Andre. The issues lie not with the core functionality itself but how to amend extensions which have a notion of numeric string literals. I have added test cases for the extension but som

Re: [PHP-DEV] Straw poll: Naming for `*any()` and `*all()` on iterables

2020-12-21 Thread Sara Golemon
On Sat, Dec 19, 2020 at 2:24 PM tyson andre wrote: > I've created a straw poll for the naming pattern to use for `*any()` and > `*all()` on iterables. > https://wiki.php.net/rfc/any_all_on_iterable_straw_poll > > This is probably going to be a terrible idea because it involves a little magic but.

Re: [PHP-DEV] Re: Straw poll: Naming for `*any()` and `*all()` on iterables

2020-12-21 Thread Larry Garfield
On Sun, Dec 20, 2020, at 5:56 PM, tyson andre wrote: > Hi Mark Randall, > > > These functions make sense. However I think we need to give renewed > > consideration to: > > > > $itr->all(); > > $itr->some(...); > > That wouldn't help for arrays, which would be the most common use case > - I don

Re: [PHP-DEV] [RFC] [Discussion] Measuring maximum execution time based on wall-time

2020-12-21 Thread Máté Kocsis
Hi Rowan and Peter, Tangentially, can this be considered a bug in FPM's handling? I appreciate > the speed boost FPM brought over CGI, but the more I work with it the less > I like the way it functions (but that is a separate conversation). > No, I don't think so, since FPM terminates the child p

Re: [PHP-DEV] [RFC] [Discussion] Measuring maximum execution time based on wall-time

2020-12-21 Thread Peter Bowyer
On Fri, 18 Dec 2020 at 16:43, Máté Kocsis wrote: > Also, please > be aware that the timeout is a clean shutdown > mechanism, so shutdown handlers and the already > mentioned RSHUTDOWN functions are triggered. On the other hand, fpm's > timeout doesn't invoke any of them. > Tangentially, can this