Re: Adding `final class Deque` to PHP

From: Date: Wed, 02 Feb 2022 15:04:46 +0000
Subject: Re: Adding `final class Deque` to PHP
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to internals+get-116972@lists.php.net to get a copy of this message
Hi Stephen, > As a userland dev & library author it’s nice to see some progression on basic data > structures, so thank you for your efforts on this! > > > Two little things in the RFC: > > 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 ? Good point. I've changed the method names to first()/last() and also made the wording in https://wiki.php.net/rfc/deque more consistently use first/last to avoid confusion. No, They're the same. front=start=bottom=first. Bottom was from SplDoublyLinkedList/SplStack, e.g. the bottom of the stack, top is where push() acts, etc. Front was how I was referring to iteration order. > In the "Why use this instead of array?” Section, the 3rd point seems cut off: > > Note that starting in php 8.2, array That should say "Note that starting in php 8.2, arrays that are lists (with no/few gaps) are represented in a more memory efficient way than associative arrays.". I've updated the RFC. Thanks, Tyson

« previous php.internals (#116972) next »