Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:130458 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 8BA7F1A00BC for ; Thu, 26 Mar 2026 07:51:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1774511519; bh=VPr/8R4j5ptXVreZOoeKoGiKuFfGjklL1ROc9lz+7+o=; h=Date:From:To:Cc:In-Reply-To:References:Subject:From; b=A9EMhdo3ohZ9mJWARqPO9rK1vkIvMUbuGov6BCqKiko2ZzVfKR106sgn8fq+iC4Jw wdVzDo8XlGyv6JbRqEDBcffiDykZKMQ7AcsDDZoS5lRAUYR0zkklp/80Rj2aOw/oS4 sKEcnrcw0On2iEuBUY3ZTEfVzjlC5nwUcz+7zA/pRU6iFkrXdM9iy4a3udh2Y/Z4Fq AcnAX/S18bWA92FpomtwS+HO3WFLRKLm1BOGCtQHVIyrcMk0p3EMrq2aXYDDDnVZuv AR3eMc2KVhHOYW0kkbny8BW0XJA3vd8acDBIdk9/o0b68rMBwWROZnV5CpcFRTDaVl qsnQxiJs0ciHg== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 4CFE01801C7 for ; Thu, 26 Mar 2026 07:51:58 +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,HTML_MESSAGE, 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-b7-smtp.messagingengine.com (fhigh-b7-smtp.messagingengine.com [202.12.124.158]) (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 07:51:57 +0000 (UTC) Received: from phl-compute-12.internal (phl-compute-12.internal [10.202.2.52]) by mailfhigh.stl.internal (Postfix) with ESMTP id 4BF797A00E7; Thu, 26 Mar 2026 03:51:52 -0400 (EDT) Received: from phl-imap-05 ([10.202.2.95]) by phl-compute-12.internal (MEProxy); Thu, 26 Mar 2026 03:51:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bottled.codes; h=cc:cc: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=fm2; t=1774511512; x= 1774597912; bh=VPr/8R4j5ptXVreZOoeKoGiKuFfGjklL1ROc9lz+7+o=; b=Q rZXiBJLTFm2nQaGNdEVGIb869pjQDfWiCk58cxdf9YkMdrXWRLIFnMiS2WSEXkZv hU/wsdzGItWapddIfxQxK0z/qyfEgfQfMTBS/082J0+PyXP27lXn0gs3E8ZQXZZU WD8jGO27KvrLnw4LJHK4XpcNK4w8cAEysMP0I/nCOSUVlvLDUYEU8r1mbJyA5X4j BvMyJ379yYXkdJo0frZy57CgfufIimcAga6HWKVw9xe7J55NiFd1Z6Hv4rPiYD4L pzRtfeA8bfzEVy2vPe/r30Llv2rptL3U1NAukRs/0Dp5aLDvDidg5oiEZPMhTbEQ lWMnjh06h2k97ajLoOvTw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc: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= 1774511512; x=1774597912; bh=VPr/8R4j5ptXVreZOoeKoGiKuFfGjklL1RO c9lz+7+o=; b=t/EyMuLWgXy54M6hcVGmZsZFFD/2aek9ohyK2rf62Qoq0+0UU9D GN/U9aKR7c2zK64BcSH3Tsl3DTBpSXQNruOf7uWqxgonmIKozrWNBCDXheyF3SLp 8Us76b/A4u7ROZuytj3d+1z0Ote6URGR8WPpNcOls8FYtXDh26XOHJtS6BdpHDaT vgwr6ZivT7jR/T+yOPH13qaeO1asTzA2MizJyZrC2JSCbvb/8F/roPZz8gM/6yi8 3Oy1CESRr33TDUj3mv9GIRVMHvkyGjU6juZPtsAH45rNgnBEkTTkfkDTc5IeSgXv lzxv8oxMt4KtLDSUOMF8UNJpx4pnVlpAw0A== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgdefvdeikedvucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhepofggfffhvfevkfgjfhfutgesrgdtreerredtjeenucfhrhhomhepfdftohgsucfn rghnuggvrhhsfdcuoehrohgssegsohhtthhlvggurdgtohguvghsqeenucggtffrrghtth gvrhhnpeeiueethedvvdefjefhgfeiheelheehtdfhfeekjefflefgvedvkeduteejjedt tdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehroh gssegsohhtthhlvggurdgtohguvghspdhnsggprhgtphhtthhopeefpdhmohguvgepshhm thhpohhuthdprhgtphhtthhopegrlhgvtgesrghlvggtrdhplhdprhgtphhtthhopegulh hivggsnhgvrhesghhmrghilhdrtghomhdprhgtphhtthhopehinhhtvghrnhgrlhhssehl ihhsthhsrdhphhhprdhnvght X-ME-Proxy: Feedback-ID: ifab94697:Fastmail Received: by mailuser.phl.internal (Postfix, from userid 501) id 6324A182007A; Thu, 26 Mar 2026 03:51:51 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface Precedence: list list-help: list-unsubscribe: list-post: List-Id: x-ms-reactions: disallow MIME-Version: 1.0 X-ThreadId: ADBKpoBI-jWR Date: Thu, 26 Mar 2026 08:51:31 +0100 To: "Dan Liebner" , "Aleksander Machniak" Cc: internals@lists.php.net Message-ID: <5c6d66c4-4c17-444e-bb0a-2b8c4759d2db@app.fastmail.com> In-Reply-To: References: Subject: Re: [PHP-DEV] [RFC] Four Pragmatic Directions for PHP: Simplicity, Arrays, Performance, Concurrency Content-Type: multipart/alternative; boundary=69221bb2a3b04e0686137674a80098cb From: rob@bottled.codes ("Rob Landers") --69221bb2a3b04e0686137674a80098cb Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable I used to have a really long and interesting blog post on PHP arrays abo= ut this: On Tue, Mar 24, 2026, at 12:04, Dan Liebner wrote: > I agree with this sentiment. >=20 > My main gripe with PHP 8 is that undefined array key accesses trigger = a warning. There is no solution to this that doesn't require destroying = the readability of a legacy codebase or using some hacky global error ha= ndler. >=20 > I think the direction should always have been this: undefined array ke= y accesses should simply return null by default. And then my disk caught on fire and it was never archived. TL;DR: treati= ng PHP arrays as an infinite field of nulls has some very interesting ma= thematical properties. No other language on earth gave you this. Practical usecases were ways to effectively "cheat" on some np-hard and = np-complete problems, like subset-sum, knapsack, Hamiltonian Path, etc. = This warning (and eventual removal of this property) makes these "cheats= " no longer possible in PHP and constrained just like every other langua= ge on the planet. =E2=80=94 Rob --69221bb2a3b04e0686137674a80098cb Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable
I used to ha= ve a really long and interesting blog post on PHP arrays about this:

On Tue, Mar 24, 2026, at 12:04, Dan Liebner wrote:=
I agree with this sentiment.

My main gripe w= ith PHP 8 is that undefined array key accesses trigger a warning. There = is no solution to this that doesn't require destroying the readability o= f a legacy codebase or using some hacky global error handler.
=
I think the direction should always have been this: undef= ined array key accesses should simply return null by default.

And then my disk caught on fire and it= was never archived. TL;DR: treating PHP arrays as an infinite field of = nulls has some very interesting mathematical properties. No other langua= ge on earth gave you this.

Practical usecases w= ere ways to effectively "cheat" on some np-hard and np-complete problems= , like subset-sum, knapsack, Hamiltonian Path, etc. This warning (and ev= entual removal of this property) makes these "cheats" no longer possible= in PHP and constrained just like every other language on the planet.

=E2=80=94 Rob
--69221bb2a3b04e0686137674a80098cb--