Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:121722 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 85556 invoked from network); 20 Nov 2023 08:35:19 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 20 Nov 2023 08:35:19 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 7D26818003F for ; Mon, 20 Nov 2023 00:35:20 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,SPF_HELO_PASS, SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from mail.online-presence.ca (online-presence.ca [216.128.176.244]) (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 ; Mon, 20 Nov 2023 00:35:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=online-presence.ca; s=default; t=1700469316; bh=t0UBF1MlMGLNawuk2NHjHIXGkvs/UUM1l3ksEL5AXTQ=; h=Date:Subject:To:References:From:In-Reply-To:From; b=jM4SgR60RG1+G69eg2wPgGsc3uVPhF+504T2ux1PX0T3io02fW1EGjN4PtKyyFOl9 UPUFC5IF0lWo5Nr8u/yPSOVo7o5Qglt8kufx45DubeGpnET4QJakfM5f2WqsUI8icM yEMHRk2M1b84FHqLhI4ppCeGKtl/3NU9mgMoWiyuj7pXfzolBgdokCRtmLgayBrfaX 9BN1njxWBqstuMMx2mks1Or9eWym4HXa60cNSLs7ntwZAf+kLTg/YYEaXhGg7q7Ws9 otP78Ryn5kV8k1wFmVjG+R69cUvjW+5NWGTpvEtKup5N8qV7AawS3IKDHwsQVO2Mzh npCkzq9FTOYSw== Received: from [10.0.0.211] (S01064075c3d865eb.ed.shawcable.net [70.74.109.64]) (Authenticated sender: lanre@online-presence.ca) by mail.online-presence.ca (Postfix) with ESMTPSA id B188D1056FF for ; Mon, 20 Nov 2023 08:35:16 +0000 (UTC) Message-ID: Date: Mon, 20 Nov 2023 01:35:15 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US To: internals@lists.php.net References: <79d675e3-95b4-40bb-baf4-3e1c998f5390@online-presence.ca> Organization: Online Presence In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] RFC Proposal - static modifier for classes From: lanre@online-presence.ca (Lanre Waju) Thank you for bringing those threads to my attention. I hadn't encountered them before, but it appears to be the typical argument of "I don't want this, so you shouldn't," along with "why do x when you can just do y (notice how y is not x)." 1. I will personally implement this feature. 2. This change is non-breaking and backward compatible. 3. It is entirely opt-in. If you hold reservations about using static classes, you can simply choose not to use them. The proposal is designed with the intention of improving code clarity, reinforcing design principles, and establishing a clear and standardized approach to expressing the intended usage of a class. While I advocate for member properties and methods to be implicitly static, I am open to understanding alternative viewpoints on why this might not be the optimal choice. Cheers, Lanre. On 2023-11-20 12:52 a.m., Rowan Tommins wrote: > On 19 November 2023 21:28:08 GMT, Lanre Waju wrote: >> Hi, similar to the abstract and readonly modifiers to classes (similar in syntax only), I propose a class level "static" modifier that ensures: > > Hi Lanre, > > There was a proposal for this several years ago which was declined at the voting stage: https://wiki.php.net/rfc/abstract_final_class > > That doesn't mean we can't look again, but any new proposal would need to at least address the reasons the previous one was declined. I believe these are the relevant discussion threads: https://externals.io/message/79211 https://externals.io/message/79338 https://externals.io/message/79601 > > My memory is that one of the main points against was that a class with only static methods is just a namespace, and you can already put functions directly in a namespace. The only issue being that we don't have good autoloading support for such functions, and that's a whole different problem... > > Regards, >