Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:123638 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 qa.php.net (Postfix) with ESMTPS id B58281A009C for ; Sun, 16 Jun 2024 15:43:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1718552710; bh=ZE48U5PCAwCGaxbbOxyqCMqLRFqflZsz0+oFBMkJzDc=; h=In-Reply-To:References:Date:From:To:Subject:From; b=dCefcPW7cbZCPT0ZsybwkJBJ2crjOcPKtS2+fSpSLNNiQAXED9p7jf9DZKy3UxXw3 m+F2gTsvzaZStYmhaAn+xw4yM0kfrWLOO9Hbd+0fldVMf/6CFW35g+VWV0n7nGhIMc amgpReDlL3QmZA62E+48Tbl89SEXF+7aN1aGA3zu9+U5EdVVT1loBihlaTtf7+GCT4 UHRpPGlX0rOodLX/SuDtBDHMq+4/4/us7Ceg/b0hfABGZoDXhqiy04gVjuZ6i/m18q WxxFBr33K3DQEafT5ejGH2bg+oxYD0zjRGA1O4cNIdQX7rjt1hwc/GhIC6r6lEJYVK OT2bqB7nI9i5g== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 8AF3D1804B6 for ; Sun, 16 Jun 2024 15:45:09 +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.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,T_SCC_BODY_TEXT_LINE 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 fout5-smtp.messagingengine.com (fout5-smtp.messagingengine.com [103.168.172.148]) (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, 16 Jun 2024 15:45:08 +0000 (UTC) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailfout.nyi.internal (Postfix) with ESMTP id 2DF811380089 for ; Sun, 16 Jun 2024 11:43:57 -0400 (EDT) Received: from imap50 ([10.202.2.100]) by compute1.internal (MEProxy); Sun, 16 Jun 2024 11:43:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= garfieldtech.com; h=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=fm1; t=1718552637; x= 1718639037; bh=jcpaRgto00HBl3yeUK5dNuInlgHeCjNma3qwwg7QinA=; b=M KDP5qFAWs3qRz0QXNHabQINmv455AQlh/d4NNLBo0w9QFwlJgog981Jisp28uvEG xMsfscQ5eWmgxv/fVXaOuP7rg1YuKHscjThH89GgIxefUe2H/KLhTnnk6zqm/VCJ SC8D6g2sa0+f0eOl1Cwe+1waXFx721kE3k0qdtTYq5am4zjsXVRyb8j5P5QmARX0 jBSHxPn6NuZQ4C44cQo31GAW+iwhBgR/IO7E7vfMNI8OeSZ1ognSPfHt26kPu0To t8oHTiDizy6izPC633LbgxjItxlR418yegFNtZcSkxPOexR9bhDFk7bz0WMfIPr8 bAYwwhzFY1xxtb2bQEpSA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=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-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; t=1718552637; x=1718639037; bh=jcpaRgto00HBl3yeUK5dNuInlgHe CjNma3qwwg7QinA=; b=pPeSzP2hJlYbIrL3op/a1vt+Pcc7Ew1TkB/mpFqLigc1 lf3ZKTj9A0e1NIy7X0vCdX9oyrg5hQqKEQd39tZI3tj6tahI2XKMymMRvhfXcGot kuEDFuIxo1awKY0yqzA84Teuy4tBDjHLJ6q0FvU6gCcaGK/p0m5jd2VaodzNAtd5 bRxIDXM1OHJD2ul11K5MJercWviOFcO+fYRAiA2PXrHdWXrEhm6HLOOp3d8CnjBw gPfYegsyO1nGQcYDB/rCcElQ7AnjyOjOaIoIW5KYp0S4RxCiobKp1MzwZo8X0InD o1Bw1kxOhIaMPigFY/odyTBmdC1MvlgwA6AxiXaV6g== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrfedvfedgledvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvffutgesthdtredtreertdenucfhrhhomhepfdfnrghr rhihucfirghrfhhivghlugdfuceolhgrrhhrhiesghgrrhhfihgvlhguthgvtghhrdgtoh hmqeenucggtffrrghtthgvrhhnpeejlefgvdegkeeutdffvdegieegueetffejueekvdeu veeifeeuudelgfduteefgfenucffohhmrghinhepphgvrghkugdrtghomhenucevlhhush htvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehlrghrrhihsehgrghr fhhivghlughtvggthhdrtghomh X-ME-Proxy: Feedback-ID: i8414410d:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id A53871700093; Sun, 16 Jun 2024 11:43:56 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.11.0-alpha0-515-g87b2bad5a-fm-20240604.001-g87b2bad5 Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net MIME-Version: 1.0 Message-ID: In-Reply-To: References: <0cf69a14-f1b5-4077-9d91-d7b579485eec@scriptfusion.com> <936e1aa3-48cc-4552-9f68-676ebcdeb596@rwec.co.uk> <1fc2f2d0-718f-45ec-8968-b66a1bde686e@scriptfusion.com> Date: Sun, 16 Jun 2024 10:43:35 -0500 To: "php internals" Subject: Re: [PHP-DEV] Static class Content-Type: text/plain From: larry@garfieldtech.com ("Larry Garfield") On Sun, Jun 16, 2024, at 10:24 AM, Andreas Hennings wrote: > Regarding function autoloading: > > A more interesting question to me is a convention where to put each function. > With classes, PSR-4 tells us exactly what one can expect to find in a > class file with a given name. > Perhaps a separate directory tree per package, with one file per sub-namespace? > Or just a package-wide functions.php? > > > Regarding static methods vs functions. > > From the older thread, I can see different levels of possible > objection to all-static classes: > 1. "Every static method should instead be either a non-static method, > or a regular procedural function." > 2. "Static methods are acceptable, but no class should exist that has > only static methods." > 3. "Static methods and all-static classes are acceptable, but no new > language feature is needed to specifically support all-static > classes." > 4. "A new language feature for all-static classes could be acceptable, > but it should be very minimal and declarative." > > I see myself somewhere between 3 and 4. For reference, I have documented my stance on statics here: https://peakd.com/hive-168588/@crell/cutting-through-the-static --Larry Garfield