Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:130459 X-Original-To: internals@lists.php.net Delivered-To: internals@lists.php.net Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5]) by lists.php.net (Postfix) with ESMTPS id 26E8B1A00BC for ; Thu, 26 Mar 2026 14:58:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1774537119; bh=s/2x5byg89hn62qOVDqPNVSXDNpjxC7W5YRTRwcV5UE=; h=Date:From:To:Subject:In-Reply-To:References:From; b=YE8Qw4dmJGUi0SFrUEtxZFr06PRNWR7FktLgXd5YdfXUTR79Pn5qVoBVy0SdHejJE eaG6+Mtipt+ICtDI7Dhldb7+HKTfU6WDaZmkYYaqDhHpShntuIUzkFIaOtkDVfF4j9 3/uRlZbA6Y7TcxHzqgjiEyaNM6J1S3J72dGmF/8+bVG/fbitIIyIx8w1+LglLt2BCw GyEz2bAVV1k1IbOSArxW4hV76tDVkOkhpCCtsRlwD5R0Q6big90nI2ft25hMeZetmN eHhkg4fSGUUKjiL2JfSotzytIMI8eEC7J+jXA+RjpFoMnrcHgPsxz6kHatFqKLFjEU nueV5GyPp6P7g== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id C7E94180037 for ; Thu, 26 Mar 2026 14:58:38 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-0.1 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_MISSING,RCVD_IN_DNSWL_LOW, SPF_HELO_PASS,SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: No X-Envelope-From: Received: from fhigh-a4-smtp.messagingengine.com (fhigh-a4-smtp.messagingengine.com [103.168.172.155]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Thu, 26 Mar 2026 14:58:28 +0000 (UTC) Received: from phl-compute-06.internal (phl-compute-06.internal [10.202.2.46]) by mailfhigh.phl.internal (Postfix) with ESMTP id D7ECB14001AD for ; Thu, 26 Mar 2026 10:58:22 -0400 (EDT) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-06.internal (MEProxy); Thu, 26 Mar 2026 10:58:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rwec.co.uk; h=cc :content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1774537102; x=1774623502; bh=s/2x5byg89hn62qOVDqPNVSXDNpjxC7W5YRTRwcV5UE=; b= Zix09CqvQwx5kumQfSB4K+P+3NIWBWFLlC3UQwNt6274aqzal09+Sessa5CvgKj3 UGCwNW3h9yBBV3N6UGTXwNijCFu/ud8sFpQ2QJZqS6jdmh5lBTJwSaPmBvHZp3Na n3fIbDbT2sRBhW6TTe/ownHHG4BnGZILfRRXWDvio1W429f37Dqu8J0nbyFJMu/+ TpQadwfNdmdhpqY3VdHL2wlBPnZhPA8qRTl4Q8/zYgeXnN5+j0RH0dkcaG8Cx54d F4Rbnv+5DlhHtnigvHwjXjrmkoDIPos7zSRpuQmuRp3ptJOG2rgrODp/Q1pjiJ7Z WTxrY0+H4G6TnIwfEfZ4zA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; t=1774537102; x=1774623502; bh=s /2x5byg89hn62qOVDqPNVSXDNpjxC7W5YRTRwcV5UE=; b=a2ZfmG7Z/enfjcVFE v4t7HznSZmbXCuraWeJEjkPrWKB8Knv0p2/3fbvNKSORr5L/mCZYyS96QQrTNFHJ 4WOVNcEPzQSBAmndH7UJl1pM2vro7vn8AnLDFOMzcgsPXi7xCMMqKDb0alC0OLWJ QQGj7jWwTOTW7KEyjq9ZId5c4I/tHcORyfeCUde8OaCIapTbmFUqnAeSUN9RxH+w 9JF+jfb3D+hQjCQyFtVPJUHr/Ok9btKtAf8vteXHNTaFYoDoL2CmuGiSXX/ndacQ Ve11G5LFbgPrKvx1OIh/vyHOj9zdAuUg4rZnuJyNKHIxELRtyZ8fBTn+pQwuCOCp GvovA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgdefvdejieekucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucenucfjughrpeffhffvufgfjghfkfggtgfgsehtqhhmtd dtreejnecuhfhrohhmpedftfhofigrnhcuvfhomhhmihhnshculgfkoffuohfrngdfuceo ihhmshhophdrphhhphesrhifvggtrdgtohdruhhkqeenucggtffrrghtthgvrhhnpeehle ffteeigfevudetfedugedtudevledugeeugeelheeihfehgfdtkeevvefgleenucevlhhu shhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehimhhsohhprdhphh hpsehrfigvtgdrtghordhukhdpnhgspghrtghpthhtohepuddpmhhouggvpehsmhhtphho uhhtpdhrtghpthhtohepihhnthgvrhhnrghlsheslhhishhtshdrphhhphdrnhgvth X-ME-Proxy: Feedback-ID: id5114917:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Thu, 26 Mar 2026 10:58:21 -0400 (EDT) Date: Thu, 26 Mar 2026 14:58:18 +0000 To: internals@lists.php.net Subject: =?US-ASCII?Q?Re=3A_=5BPHP-DEV=5D_=5BRFC=5D_Four_Pragmatic_Directions_for?= =?US-ASCII?Q?_PHP=3A_Simplicity=2C_Arrays=2C_Performance=2C_Concurrency?= User-Agent: K-9 Mail for Android In-Reply-To: <5c6d66c4-4c17-444e-bb0a-2b8c4759d2db@app.fastmail.com> References: <5c6d66c4-4c17-444e-bb0a-2b8c4759d2db@app.fastmail.com> Message-ID: <48BA5AE0-FADB-4675-B2FC-D56AB7A793CA@rwec.co.uk> Precedence: list list-help: list-unsubscribe: list-post: List-Id: x-ms-reactions: disallow MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: imsop.php@rwec.co.uk ("Rowan Tommins [IMSoP]") On 26 March 2026 07:51:31 GMT, Rob Landers wrote: >And then my disk caught on fire and it was never archived=2E TL;DR: treat= ing PHP arrays as an infinite field of nulls has some very interesting math= ematical properties=2E No other language on earth gave you this=2E I agree that some useful use cases have been "thrown out with the bathwate= r" by trying to make array access less prone to mistakes=2E=20 I think the pragmatic response to that is to propose new features that cat= er *even better* to those use cases=2E For instance:=20 - an "optional key access" operator like $foo[?'bar'] that makes the inten= t explicit but concise - a PHP version of Python's "defaultdict", which lets you *choose* the def= ault value for undefined items, rather than always null=20 - copy-on-write structs with predefined keys At the same time, PHP has always been a long way behind other languages wh= en it comes to lazy lists and iterators; I would love to see: - a "sparse list" type, where you can define the size and initial value wi= thout allocating memory for all elements - lazy ranges - built-in functions or operators which can operate lazily on iterators (i= =2Ee=2E without enumerating them) These aren't trivial to design and implement, but it would be great to tra= nsfer some of the energy from "I don't like this thing someone else wanted"= into "I want this thing as well"=2E Regards, Rowan Tommins [IMSoP]