[PHP-DEV] Adding `final class Deque` to PHP

2021-09-19 Thread tyson andre
Hi internals, I've created a new RFC https://wiki.php.net/rfc/deque to add a `final class Deque` This is based on the `Teds\Deque` implementation I've worked on for the https://github.com/TysonAndre/pecl-teds PECL. While `SplDoublyLinkedList` and its subclass `SplQueue`/`SplStack` exist in the

Re: [PHP-DEV] Proposal: Adding an ARRAY_FILTER_REINDEX flag to array_values

2021-09-19 Thread Larry Garfield
On Sun, Sep 19, 2021, at 8:11 AM, tyson andre wrote: > Hi internals, > > Currently, array_filter will always return the original keys. > This often requires an additional wrapping call of > array_values(array_filter(...)) to reindex the keys and return a list. > (or applications may not realize t

Re: [PHP-DEV] [RFC] $this return type

2021-09-19 Thread Nicolas Grekas
Hi Nikita Hi internals, > > I'd like to pick up a loose thread from the future scope of the > https://wiki.php.net/rfc/static_return_type RFC, the $this return type for > fluent APIs: > > https://wiki.php.net/rfc/this_return_type > > I have some reservations about this (which basically come down t

[PHP-DEV] Proposal: Adding an ARRAY_FILTER_REINDEX flag to array_values

2021-09-19 Thread tyson andre
Hi internals, Currently, array_filter will always return the original keys. This often requires an additional wrapping call of array_values(array_filter(...)) to reindex the keys and return a list. (or applications may not realize there will be gaps in the keys until it causes a bug or unexpecte

Re: [PHP-DEV] RFC: Add `final class Vector` to PHP

2021-09-19 Thread tyson andre
Hi Mike Schinkel, > >> Given there seems to be a lot of concern about the approach the RFC > >> proposes would it not address the concerns about memory usage and > >> performance if several methods were added to SplFixedArray instead (as > >> well as functions like indexOf(), contains(), map()