Re: Adding `final class Deque` to PHP

From: Date: Wed, 22 Sep 2021 03:17:23 +0000
Subject: Re: Adding `final class Deque` to PHP
References: 1 2 3 4 5 6 7 8  Groups: php.internals 
Request: Send a blank email to internals+get-116121@lists.php.net to get a copy of this message
> "Maximum size" shouldn't be an issue for Deque > specifically, it's a size_t. It isn't an issue for > SplFixedArray and ArrayObject. > (or for > PHP would just encounter a fatal error due to either You wrote a lot, but unfortunately it was based on a misunderstanding. In some languages you can set the maximum allowed number of items a specific Deque can hold. For example (pseudo-code): let deque = new Deque<int>(max_capacity: 3) deque.push_back(1) deque.push_back(2) deque.push_back(3) # okay, it's now full deque.push_back(4) # ! In this condition, they either error or remove the earliest. It's okay if the proposed Deque doesn't add this capability, but it's the only remaining major functionality which some languages have but not the others; it should at least be discussed, I think.

« previous php.internals (#116121) next »