Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:130436 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 5CAE71A00BC for ; Tue, 24 Mar 2026 19:02:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1774378980; bh=h2AgxM0DV36UeOIhB8jEWrActSvVO2JP5aaEl4tLuK8=; h=Date:From:To:In-Reply-To:References:Subject:From; b=WiO7WREuC5bPcFGoKnIt6uBA2N+O9RPNSH5Ixr/8HMeiwUbvR6brh5fP/JC1/Kla8 gClFUSrH0aYjay6fXby0J1Hg6G9zuu7S2nWR4jtL1Cv63h1rYH4UAKnF91FF76t/Zg y2b320V7PA/pPyViG8uAJEE1ez22Rzn8+alugTFiMEE9gQy9rvH+uxrBvp2tSkL7Kg yLkJXiIUVhZfH74tCdJ+POzaY6oVOzwsECPIyc23vKu6eaRq84n2MLDPDKEXHhxG9W +XH6WK3ppPgEm2s9hoT/fo3LYIpRWjXZOQWgubwW4LD+VfMKNuqf+igVqcM1//vDjl w/Jcba2+AGBBQ== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 2BCC1180595 for ; Tue, 24 Mar 2026 19:03:00 +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_NONE autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: No X-Envelope-From: Received: from fhigh-a8-smtp.messagingengine.com (fhigh-a8-smtp.messagingengine.com [103.168.172.159]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Tue, 24 Mar 2026 19:02:50 +0000 (UTC) Received: from phl-compute-04.internal (phl-compute-04.internal [10.202.2.44]) by mailfhigh.phl.internal (Postfix) with ESMTP id BFA92140012A for ; Tue, 24 Mar 2026 15:02:44 -0400 (EDT) Received: from phl-imap-02 ([10.202.2.81]) by phl-compute-04.internal (MEProxy); Tue, 24 Mar 2026 15:02:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= garfieldtech.com; 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=1774378964; x=1774465364; bh=9pt+QmcKdZlYCDgCrxwif ZkbCqsPpZ0afszP4BLxKd4=; b=jN+bFi7o7WuKSWMwgbLINaod4Jt3+o8SH/yW9 W7JLFRRl2+nN6HOmMiDaMz3rlDHz35KE1XqSTHZxUGSmUiy9MtsaqrI6f9ci3Xtu UEX1HshdWZRObrOfAeJOhQmG17GUHD4sAtFxBXNYet6cFbwj1hb+OqDU52PJOp69 YUFMin3r3hE02zx1XAoVlxPLazQmwu/sx57RV2GLfalnuX1eITtMfD/i+S1jFf0a ctdJcYJH0atQASGesPh9GaknOLe3+KYQFLOidm4iasHcJfkypRnmRKZcwg1CmcQN x/sNZMhJG8BQ35HPZpa/Qj4w4xkCEiWlT7An5GeEgp4XiRDuw== 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=1774378964; x=1774465364; bh=9 pt+QmcKdZlYCDgCrxwifZkbCqsPpZ0afszP4BLxKd4=; b=HYWNh0WBUwiAO05rS jpJrenwnBMIHI8LXCwmAqgiXuqyVT+Xu2S4/8xJp4eERiWxMEVR0loY5DN6YX57Q obbGYkaoFR20O8NkljC9yKti0HsEbJWdCb4JgqoDKVYqnnJYcb0yqhZ6EYMf+KVG ediutket4On9a6Jns/QQgcvkioeffJ7wSXsB15UTGC7WrMMYr4BBCvaMof1WFrjS 0BqNSminmuu/58LzIH3WvNKZtBHpc8hbyjojdKseutCTU2m8sHEWkszYFTKcbTyp AGgV7CSYDXyve7FlNwP8OqdsJLSToLiO7I54IUn+62zOjN1C3tis1PjabAt5TQyR YeI6w== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgdefvddvfeejucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhepofggfffhvffkjghfufgtgfesthhqredtredtjeenucfhrhhomhepfdfnrghrrhih ucfirghrfhhivghlugdfuceolhgrrhhrhiesghgrrhhfihgvlhguthgvtghhrdgtohhmqe enucggtffrrghtthgvrhhnpeffieeivdfhvdeguddttdegteeiueegvefhteehfeeffeet udeitdehtdegjeeuieenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrih hlfhhrohhmpehlrghrrhihsehgrghrfhhivghlughtvggthhdrtghomhdpnhgspghrtghp thhtohepuddpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepihhnthgvrhhnrghlsh eslhhishhtshdrphhhphdrnhgvth X-ME-Proxy: Feedback-ID: i8414410d:Fastmail Received: by mailuser.phl.internal (Postfix, from userid 501) id 8A7FC700065; Tue, 24 Mar 2026 15:02:44 -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: AMHH0AXb0SG7 Date: Tue, 24 Mar 2026 14:02:23 -0500 To: "php internals" Message-ID: In-Reply-To: References: Subject: Re: [PHP-DEV] [RFC] Four Pragmatic Directions for PHP: Simplicity, Arrays, Performance, Concurrency Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: larry@garfieldtech.com ("Larry Garfield") On Tue, Mar 24, 2026, at 5:08 AM, =E6=B2=89=E9=BB=98=E9=A2=86=E5=9F=9F=E3= =80=81 wrote: > Hi internals, > > > I'm a developer who uses both Java and PHP regularly. I'm writing > because I care about PHP's future. > > PHP's strength has always been simplicity and pragmatism. But since > PHP 7 and especially PHP 8, we've been adding "enterprise features" > (typed properties, attributes, property hooks) that make PHP more like > Java =E2=80=93 without achieving Java's type safety or ecosystem. > > I believe PHP should refocus on what made it great. Here are four > pragmatic directions: > > --- > > 1. Stop Chasing Java > > Every "enterprise feature" pushes developers like me toward Java. Not > because Java is better, but because if I need enterprise complexity > anyway, I'd rather use a language designed for it. > > PHP cannot beat Java at its own game. But it can beat Java where it > matters: rapid prototyping, simple deployment, web-native development, > low learning curve. > > Please keep PHP simple. Keep it pragmatic. This accusation has been thrown at PHP every few months since PHP 5.0 ca= me out (which did indeed ape Java 2 for much of its OOP syntax and behav= ior). It's really a farcical misunderstanding of language design, "ente= rprise features," and "pragmatism." Many of the features added in the 8.0+ era are simple syntactic sugar to= reduce typing. Is that "enterprise?" Typed properties greatly reduce = the amount of error handling needed, and the amount of tests needed. Is= that "enterprise?" Property hooks vastly reduce the need for boilerpla= te code, making it faster and easier to bang out code that is forward-co= mpatible. Is that "enterprise?" The programming language community at large keeps learning, and has lear= ned a ton since the 90s. One thing it has learned, but many developers = have not, is that "code that finds errors for you at compile time" is NO= T an enterprise feature. It's an everybody feature, which is why virtua= lly every untyped language has had some form of types added to it, in va= rious ways. (PHP directly, Python via unenforced annotations, Javascrip= t via TypeScript, etc.) > 2. Add Practical Array Helpers > > PHP is a web language =E2=80=93 90% of what we do is manipulate arrays= . Yet > basic operations are still verbose: > > ```php > // Current > $names =3D array_values(array_filter($users, fn($u) =3D> $u->active)); > $first =3D count($names) > 0 ? $names[0] : null; > > // Proposed > $names =3D array_pluck($users, 'name'); > $names =3D array_where($users, fn($u) =3D> $u->active); > $first =3D array_first($users); > $grouped =3D array_group_by($users, 'role'); > $compact =3D array_compact($data); > > These helpers would make everyday code cleaner without adding > complexity. You may have noticed that a number of array and string helper functions = have been added in recent years. If there are more that you feel should= be, RFCs are welcome. Just adding an array function is probably one of= the simplest technical RFCs to write. > 1. Improve Performance > > Performance has always been a strength. Keep optimizing: > > =E2=80=A2 JIT for real-world web workloads > > =E2=80=A2 Reduce memory allocation in array operations > > =E2=80=A2 Make OpCache smarter All of these are happening, to the extent possible. > 1. Provide Built-in Concurrency (Without Complexity) > > Concurrency is the biggest missing piece. But instead of complex > async/await or coroutines, consider a simple worker management API: > > php > $server =3D new WorkerServer(); > $server->onWorkerStart(fn() =3D> loadApp()); > $server->onRequest(fn($req) =3D> handle($req)); > $server->start(4); > This would: > > =E2=80=A2 Run standalone: `php server.php` =E2=80=93 no nginx, no PHP= -FPM > > =E2=80=A2 Keep process isolation (each worker is separate) > > =E2=80=A2 Allow resource initialization once per worker > > =E2=80=A2 Give developers control without new concepts > > Why not just use FrankenPHP? FrankenPHP is excellent, but requires an > additional binary and new deployment workflow. Many developers just > want a simple, built-in way to run their app without configuring two > services. You may not have noticed, if you're new to the list, but there has been = an extensive and ongoing discussion of improved async support, with a lo= t of focus on how to make it easy to use right and hard to use wrong. B= ecause that is actually a really, really hard problem space. "Simple wo= rker management" is not actually simple, when you dig into it. There's = a lot of things that can go wrong, and designing it (both the code and t= he APi) such that it's hard to have things go wrong is itself really har= d. That's why it's going on over a year now. Rest assured, there's an awful lot of people that really want good async= /workers/etc. But it's nowhere near as easy as you think, or it would b= e done already. (See also: generics.) --Larry Garfield