[PHP-DEV] Re: [RFC] Configurable callback to dump results of expressions in `php -a`

2021-01-05 Thread tyson andre
Hi internals, > I've created a new RFC > https://wiki.php.net/rfc/readline_interactive_shell_result_function > adding a way to configure a callback to be called to dump the value of > single-expression statements from `php -a` > (and an ini setting that can be disabled to prevent that callback f

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

2021-01-05 Thread tyson andre
Hi internals, > 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 > > Background: The RFC https://wiki.php.net/rfc/any_all_on_iterable proposes > adding only two functions, > but more funct

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

2021-01-05 Thread tyson andre
Hi internals, > > > I probably brought this up in a previous thread, but I think it's worth > > > considering again here, given recent changes to the RFC: > > > > > > I think it would make more sense to introduce this as `function > > > array_is_list(array $array): bool`. That is, a function that

Re: [PHP-DEV] [RFC] Enumerations, Round 2

2021-01-05 Thread Larry Garfield
On Tue, Jan 5, 2021, at 8:26 AM, Nikita Popov wrote: > Nice work, I like the updated proposal. Some notes: > > > Similarly, enum names and case names are both case insensitive. > > I agree that enum names should be case insensitive (like class names), but > why should case names be case insensit

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

2021-01-05 Thread Go Kudo
Thanks Nikita. Thanks for the input. This looks like a very smart solution. I've edited the RFC and added a new proposal as TypeC. https://wiki.php.net/rfc/object_scope_prng However, I have a couple of concerns. The first is that users will have to be careful with RNG instances (for better or wo

Re: [PHP-DEV] Mysqli improvements

2021-01-05 Thread Nikita Popov
On Wed, Dec 30, 2020 at 7:33 PM Kamil Tekiela wrote: > Hi Internals, > > I would like to start a discussion about possible improvements to the > mysqli API. I have written an RFC which explains all my ideas. > > https://wiki.php.net/rfc/improve_mysqli > > As the RFC is nothing more than a concept

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

2021-01-05 Thread tyson andre
Hi Nikita Popov and Benjamin Morel, > > I probably brought this up in a previous thread, but I think it's worth > > considering again here, given recent changes to the RFC: > > > > I think it would make more sense to introduce this as `function > > array_is_list(array $array): bool`. That is, a f

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

2021-01-05 Thread Nikita Popov
On Thu, Dec 24, 2020 at 5:12 PM zeriyoshi wrote: > I updated the RFC draft and changed it to a proposal to bifurcate the > interface. > > https://wiki.php.net/rfc/object_scope_prng > > At the same time, I was looking into the RNG problem in Swoole and found > out that the problem was actually occ

Re: [PHP-DEV] [RFC] Enumerations, Round 2

2021-01-05 Thread Nikita Popov
On Mon, Dec 28, 2020 at 9:22 PM Larry Garfield wrote: > Hello, Internalians! > > After considerable discussion and effort, Ilija and I are ready to offer > you round 2 on enumerations. This is in the spirit of the previous > discussion, but based on that discussion a great deal has been reworked

Re: [PHP-DEV] [RFC] Configurable callback to dump results of expressions in `php -a`

2021-01-05 Thread Rowan Tommins
On 03/01/2021 20:45, tyson andre wrote: __debugInfo() is a slight improvement, but the human-readable representation of an object isn't always the same thing as the debug representation of the object. A human-readable representation might be `Point(x: 1, y: 2)`, where var_dump or var_export(`__

Re: [PHP-DEV] Proposal: Adding SplFixedArray->push() and SplFixedArray->pop()

2021-01-05 Thread Nikita Popov
On Mon, Jan 4, 2021 at 4:58 PM Levi Morrison via internals < internals@lists.php.net> wrote: > On Tue, Dec 29, 2020 at 10:04 AM tyson andre > wrote: > > > > Hi Internals, > > > > Currently, PHP doesn't have a built in memory-efficient array type with > convenient push, pop, and other operations,

Re: [PHP-DEV] [RFC] Enumerations, Round 2

2021-01-05 Thread Rowan Tommins
On 04/01/2021 22:04, Mike Schinkel wrote: I don't quit get how you are thinking of with ": string"; can you give an example? The current RFC requires the declaration of a Scalar Enum [1] to include the scalar type, so it looks like this: enum BookingStatus: string {   case PENDING = "P

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

2021-01-05 Thread Benjamin Morel
> I probably brought this up in a previous thread, but I think it's worth > considering again here, given recent changes to the RFC: > > I think it would make more sense to introduce this as `function > array_is_list(array $array): bool`. That is, a function that only accepts > arrays in the fir

Re: [PHP-DEV] [RFC] Bundling ext/simdjson into core

2021-01-05 Thread Nikita Popov
On Tue, Dec 29, 2020 at 5:58 PM Máté Kocsis wrote: > Hi Internals, > > I think this will be my last proposal for quite some while :) > But this time, I'd like to propose bundling the > https://github.com/crazyxman/simdjson_php extension > with some major modifications. > > The proposed OO API is

Re: [PHP-DEV] Does PHP ever stack allocate?

2021-01-05 Thread Nikita Popov
On Mon, Jan 4, 2021 at 11:53 AM Olle Härstedt wrote: > 2021-01-03 17:43 GMT, tyson andre : > > Hi Olle, > > > >> Thanks Sara! I realize I should have been more precise: Can PHP > >> allocate non-reference counted memory that automatically is freed when > >> leaving scope, similar to what Go does

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

2021-01-05 Thread Nikita Popov
On Sun, Dec 20, 2020 at 2:43 AM 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 .. > count($value)-1` in that

Re: [PHP-DEV] [RFC] Enumerations, Round 2

2021-01-05 Thread Peter Bowyer
On Mon, 4 Jan 2021 at 15:21, Pierre R. wrote: > I do not agree with having values per default, this is error prone in > most of my use cases. > > In most case where I need enums, I often need to replicate those in > database too, or in message broker serialized messages: in this context, > whenev