Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:127286 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 8D43D1A00BC for ; Sun, 4 May 2025 21:37:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1746394533; bh=BNFncc8QmCxQ25tpOxkrGSyIuCB8l32PK8PepCFp4MU=; h=Date:From:To:In-Reply-To:References:Subject:From; b=FY0dSxQ7fZceUE5vmGR+gP8GcSEFrEtHuKwEmWltB+qJXDz1vKaYF3P6w9cS4L/Pk aO6awTUEuc/M/NyDPg7mv0GuDAnAmuRT01ueadBl5dqG9q4cRevw3221chONmf9MZy 3EcwIU8uJ1eofoV27WXemm99/463zcyBfdd+j+Mp0G5Z89cwx2PXKFNHrjHyE3Vnn3 MKrF7VT5P4xW+UUHrJ9bei/uaQqwADUgEcV0uSbDGpHR1thxCh0l+yx62grrDnNrIo OmBkNHnxGJT5rncXmJclYqxxy2Cajv0BChSsN9dESPxZXvQ5kaRrzOAakfCl4v6eMg W42FiDEmAn8/w== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id D02351801E3 for ; Sun, 4 May 2025 21:35:32 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_40,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.0 X-Spam-Virus: Error (Cannot connect to unix socket '/var/run/clamav/clamd.ctl': connect: Connection refused) X-Envelope-From: Received: from fhigh-a5-smtp.messagingengine.com (fhigh-a5-smtp.messagingengine.com [103.168.172.156]) (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 ; Sun, 4 May 2025 21:35:32 +0000 (UTC) Received: from phl-compute-10.internal (phl-compute-10.phl.internal [10.202.2.50]) by mailfhigh.phl.internal (Postfix) with ESMTP id E9C9A11401BA for ; Sun, 4 May 2025 17:37:46 -0400 (EDT) Received: from phl-imap-06 ([10.202.2.83]) by phl-compute-10.internal (MEProxy); Sun, 04 May 2025 17:37:46 -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=fm3; t=1746394666; x=1746481066; bh=v9EhuLGkTCCPfTNdeJNKn p9uqmEQ3YV+fT5EblxFlRM=; b=yS+6W3Qz1gnqZFS3xiungNXd8deTr0RO90nLu Of0pXB5xtaISdCWdZ6UzPyw1ywhPXx+NacSsr0tZO6BzskM8qgLBLEHm5qwvoULw u5KJyyV5cPM6idrLpeJ7dOYwSEo7x/Fc9eK5lRacZy2zqw/7ZbwdcxF0aw55OOHx CA5BZhNnrK4zV8ACaqQxceK2WSjXbqfFVmveLaTZ/21mdbaMuDVSZzAHlHbvsvkP QMDjMg/p/ksvg6kleUmN/DRXWrdqvzGEzqERPTCyu5XbfQlvcSgiKmhjKg0/A0BS Lnz2m1b8wOAPQaPbElLSjvgAnt0SNCSaw0lkCWSpZsPWWtTOA== 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=fm3; t=1746394666; x=1746481066; bh=v 9EhuLGkTCCPfTNdeJNKnp9uqmEQ3YV+fT5EblxFlRM=; b=e1fuHbdy2oqLqaWM8 dyFJWhStJWcm7rsf8oO2cspTcl1soeGX6mPXNdzvvbaPT3EGD0oCe+iTS87aj2cb PJ+OrR75zhBbAKZXqk7/OffEB2CWDdhGKMm7ww5xBZOHsO/AtoQZCOL4ZP+igYua QYLOisN1x+MnGl1l2k3cRnWLJSydurSXeYhCwsdNFK18uFmbgxLepvnromDz8mGV iT4Ba2R4+TAPXsDu1QN29Qtj/yXrB9zWlIBO027uLMbgBQOAja/K2w4iYdhadJGW aIHfKeRh3YJIdEK1yk0fUsm1HjCgqXBa7aNXpZmbly05FM9WKg7/+nRznTp3TwX+ 2CMyw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddvjeelfeduucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggv pdfurfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpih gvnhhtshculddquddttddmnecujfgurhepofggfffhvffkjghfufgtgfesthhqredtredt jeenucfhrhhomhepfdfnrghrrhihucfirghrfhhivghlugdfuceolhgrrhhrhiesghgrrh hfihgvlhguthgvtghhrdgtohhmqeenucggtffrrghtthgvrhhnpeffieeivdfhvdeguddt tdegteeiueegvefhteehfeeffeetudeitdehtdegjeeuieenucevlhhushhtvghrufhiii gvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehlrghrrhihsehgrghrfhhivghlught vggthhdrtghomhdpnhgspghrtghpthhtohepuddpmhhouggvpehsmhhtphhouhhtpdhrtg hpthhtohepihhnthgvrhhnrghlsheslhhishhtshdrphhhphdrnhgvth X-ME-Proxy: Feedback-ID: i8414410d:Fastmail Received: by mailuser.phl.internal (Postfix, from userid 501) id 9F52C29C0072; Sun, 4 May 2025 17:37:46 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 X-ThreadId: T2a4bd2276428daf8 Date: Sun, 04 May 2025 16:37:23 -0500 To: "php internals" Message-ID: <15a33d20-47c1-443e-aafd-f39bd8f367c1@app.fastmail.com> In-Reply-To: References: <9cbbe803-5fd1-4011-b42e-033d4ede3fe9@app.fastmail.com> Subject: Re: [PHP-DEV] Modules, again. Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: larry@garfieldtech.com ("Larry Garfield") On Sun, May 4, 2025, at 4:25 PM, Michael Morris wrote: > On Sun, May 4, 2025 at 5:19=E2=80=AFPM Larry Garfield wrote: >> On Sun, May 4, 2025, at 2:34 AM, Michael Morris wrote: >> > It's been 9 months. Been researching, working on other projects,=20 >> > mulling over=20 >> > points raised the last time I brought this up. And at the moment I=20 >> > don't think=20 >> > PHP 8.5 is in its final weeks so this isn't a distraction for that.= =20 >> > The=20 >> > previous discussion got seriously, seriously derailed and I got los= t=20 >> > even though=20 >> > I started it. I'm not going to ask anyone to dig into the archives,=20 >> > let's just=20 >> > start afresh. >>=20 >> This proposal requires: >>=20 >> 1. Every module author to change their coding structure >> 2. Every consumer of a package to change their coding structure >> 3. Devs to abandon "it just works" autoloading and explicitly import = packages. >> 4. Abandoning 16 years of PSR-0/4 file convention in favor of "module= =3D file", which will almost certainly result in multi-thousand-line fi= les even for clean, well-factored code. > > You're 4 for 4 on falsehoods. Care to actually read what I wrote=20 > because I know you're more intelligent and better than this and very=20 > disappointed.=20 > PHP Code -------------------------------------------------------------= ---------- > > namespace MyModule; > > yield function sum(a, b) { return a + b; } > > ----------------------------------------------------------------------= ---------- Every module author changes their code. (Which is reasonable.) > PHP Code -------------------------------------------------------------= ---------- > > use require 'mymodule.php'; > > echo MyModule::sum(3, 4); > ----------------------------------------------------------------------= ---------- Every caller changes their code, to use `use require` and to use the pse= udo-class syntax to call the function. > PHP Code -------------------------------------------------------------= ---------- > > use sum require 'mymodule.php'; > > echo sum(3, 4); // 7 > ----------------------------------------------------------------------= ---------- Removes the pseudo-class syntax, but still has the "use sum require..." = change for the consumer. As described, the implication is that the millions of existing use Some\Class\Here; lines in code in the wild will... not work if the Some\Class package bec= omes a module? I think that's what's implied, but it's not clear. If t= hat triggers autoloading, how does the autoloader know how to find it? = It needs to know the module name, which as described is the file name of= the module, not the class. =20 Since the module name is the file name, that means if a module has 50 in= ternal classes, it must be in the same file. Hence, giant files. If those reads of your post are inaccurate, then please show with exampl= es how they are inaccurate, because that is how I understood your propos= al text at face value. --Larry Garfield