Re: Adding `final class Deque` to PHP
| From: | tyson andre | Date: | Wed, 02 Feb 2022 14:37:59 +0000 |
| Subject: | Re: Adding `final class Deque` to PHP | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-116970@lists.php.net to get a copy of this message | ||
Hi Mel Dafert,
> >The proposed API switches between terms
front,
> >back, start and
> >end in comments - is there meant to be a conceptual difference
> >between front/start and end/back ?
>
> On a similar note, why are the methods for getting the first/last value called
> top()/bottom()? Off the top of
> my head, it is hard for me to imagine which side is
> the top and which side is the bottom.
> I would prefer if it was called something more intuitive, possibly
> first()/last() in
> accordance with
> array_key_first()/array_key_last().
I've changed it to first/last in https://wiki.php.net/rfc/deque
I'd forgotten about first/last when looking for existing names php used for methods/global
functions.
The closest I'd seen was in SplDoublyLinkedList, I'd forgotten about https://php.net/array_key_last getting added in php 7.3
(due to it existing for keys but not values)
Thanks,
Tyson