Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:116121 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 8490 invoked from network); 22 Sep 2021 02:36:29 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 22 Sep 2021 02:36:29 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 311C91804B2 for ; Tue, 21 Sep 2021 20:17:36 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MISSING_HEADERS, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-qk1-f169.google.com (mail-qk1-f169.google.com [209.85.222.169]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Tue, 21 Sep 2021 20:17:35 -0700 (PDT) Received: by mail-qk1-f169.google.com with SMTP id 138so4577430qko.10 for ; Tue, 21 Sep 2021 20:17:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=datadoghq.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:cc; bh=Kl/UP3GXgr+ofz9sn/FoYjlNzbHL2Nm4dtrLfjlXqwU=; b=gxfhdIFoHGNNWfiJLe872BH+BF++dUKYcZw1HeovhtxuB8+Pzh/eEkGSJ2dAjjabyz L15bBn+aCoicyTRBzlYhJiemzDauF44Xuuv6W192F3llFTT8pqhazJSdL5s2ZTlOJ/Au ZaKZqXt897w/l9kYai/gX5WuDpbXYTXQaC/VU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:cc; bh=Kl/UP3GXgr+ofz9sn/FoYjlNzbHL2Nm4dtrLfjlXqwU=; b=EtyJAYSg3WHSfLu9aW2xiVBcN8WPfPXGL4qvlf5fJyB3nSzYOVABgyc6oYLjBeyI0P cd4itEJno/+u5+BnKJRdXMU2wzf9NBPBXHrU579NjTlx+t2FQU0h6gfzCx6Q1xrgMNkN Wj47l8CCyxmvHhI6PLSxQ9O8MTvPDgoiPLPI9G0AydGLyvGi2jDaDvO1koAY9lxcao1F p2WzrT3iMYMGd3c5hiuhsKcnUrlkj7miEQy5em4cMD+y8CGIBKvprX+FnxTF69O1x3KM o9ogvou4ps0dmecdwVdvI2eHzaRaE6XlnYeuBIj1DwYZd9KH7AA8nxwZJ9tYyFCIJDLR lC4A== X-Gm-Message-State: AOAM530VXeiurmPmgxhanye9AboWOTX2V325q5SRTRxeg931Txa2Mimr +LEf/Vj++dBapUW/5q/YS4jaUsmpsJPe66or64iFTs+l+pHxWg== X-Google-Smtp-Source: ABdhPJyAXHoIQQ+QXDeEaLBJFawAi2rTOwTyRFcfV+7eUQ/sXvH9Bi5xqTxR69ihIhpHFhRSm2UxFMsSrwmujITYol0= X-Received: by 2002:a25:905:: with SMTP id 5mr42684249ybj.293.1632280653994; Tue, 21 Sep 2021 20:17:33 -0700 (PDT) MIME-Version: 1.0 References: <67BFE5C6-3C3F-4309-97A2-14CA0D8C3B3B@newclarity.net> <7BEE0406-3CAE-4E83-A196-F9F608BE8D17@newclarity.net> In-Reply-To: Reply-To: Levi Morrison Date: Tue, 21 Sep 2021 21:17:23 -0600 Message-ID: Cc: PHP internals Content-Type: text/plain; charset="UTF-8" Subject: Re: [PHP-DEV] Adding `final class Deque` to PHP From: internals@lists.php.net ("Levi Morrison via internals") > "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(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.