Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:123708 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 9513F1A009C for ; Thu, 20 Jun 2024 20:07:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1718914137; bh=VJtnaK14xoUWnaFBVVYofLwMZ4e79zw4YgQSIzh/ce4=; h=Date:Subject:To:References:From:In-Reply-To:From; b=iYoQL+28jpfR8a3Q00cufTN8kEZf6y6thu0kOiPvDnO4pxCqH5AHgWardWWE1i9EE MOwsdd0/4iUci2Orvhmkfo3YWBfvtomyyccC6YFM87/Z2Glm9aJKsrvPSJ0z5yBpvn zKG6xE3kO9W0Dvm9kb/S1/QpN/h9Xu/N3MLgw8OodBq3ledmX9bhAjCJbMY05v4Z2r B49smxrBvtXWO3OlMXjI6Ar5zEO7zxnsDFifEXHC9jlAfR13R22o3zqQ7tYESPiquE WwBF5QWWDctCrS2lMbULJ+kOg0BO+jydmPc7Bi/W/aVEl4+h836KulGcWr+R2BLG6k xwqj9KLQVPeAg== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id AF7AE180069 for ; Thu, 20 Jun 2024 20:08:55 +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_PASS,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 fout3-smtp.messagingengine.com (fout3-smtp.messagingengine.com [103.168.172.146]) (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, 20 Jun 2024 20:08:55 +0000 (UTC) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailfout.nyi.internal (Postfix) with ESMTP id 7721D1380105 for ; Thu, 20 Jun 2024 16:07:40 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Thu, 20 Jun 2024 16:07:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rwec.co.uk; 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=fm2; t=1718914060; x=1719000460; bh=Jnbm3bc1Bv6C7laR7ta3DI0nYXaTMmljEE++u5oBPDQ=; b= sGpOLQ8EHvRIbuuuszCqkrvgsqDNxkKgaNdAwIlhF6mC42lUvb+/k3cYwvHUSIfX OcEeQL3+ofMblg1PCJLj2SVatpSzN9zq79eUV+21Tecwi5rE8+wUaJ08GWEWo/WH VRi4mLdi+AZjKK8UdAYrAe9n61EOwHQz5qQeGnlh6GT8cy9/ION9kI2TSF8j8/nq XgGKaQUEBRdnK3KTf9B1S83trPFizyvucMafHrNbc+0f04BzQ8XF8eGWMEayew+U tfXvqMQwAU/PkUU7iBk7k1sXtxMSpdPD6NNZTAWujsahdyrHnYICFf14/s9i4PaZ Y0riGiOY4NCUKyG7gKgiAQ== 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-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1718914060; x= 1719000460; bh=Jnbm3bc1Bv6C7laR7ta3DI0nYXaTMmljEE++u5oBPDQ=; b=L pDsuHOZMU8B5zu9HeWV5NTC7wfyL22T9ZJsTBsgmC4EB7b3QXYiJjbIFGWi81Ft5 BQAecXcVJRc3lfa02Wqy7Z0il4TyDp98AJhUO9kT5oSIlly0Q0jiEFryxkKRXMaU WXyu7Yyr75GJeaSm1F2wHugNBeX3WMT6NUnemJjBwHEaWXwGx35vVb52BUuCGIr1 FzyAE/F2vJQeSZKV9a0BawcoeGCWgNBuq3vrLy8jADIVPxMYTMuVe9ycM98glkUK w7txp9nW3+KvrKXcBAOll9t/uEBpFpFiwKX0RnqGVMMoHrn19RWCEwj8zgtTxvc2 rel2+FUsCaGpNIM8+PNdA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrfeefvddgudegjecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhepkfffgggfuffvfhfhjggtgfesth ejredttddvjeenucfhrhhomhepfdftohifrghnucfvohhmmhhinhhsucglkffoufhorfgn fdcuoehimhhsohhprdhphhhpsehrfigvtgdrtghordhukheqnecuggftrfgrthhtvghrnh ephfdugeegheeggeduhfeuudetuedtieelgedtgfefffelheekffehleelgefffeelnecu ffhomhgrihhnpegvgihtvghrnhgrlhhsrdhiohdpphhhphdrnhgvthenucevlhhushhtvg hrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehimhhsohhprdhphhhpsehr figvtgdrtghordhukh X-ME-Proxy: Feedback-ID: id5114917:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Thu, 20 Jun 2024 16:07:39 -0400 (EDT) Message-ID: Date: Thu, 20 Jun 2024 21:07:34 +0100 Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PHP-DEV] [RFC] Static Constructor To: internals@lists.php.net References: Content-Language: en-GB In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit From: imsop.php@rwec.co.uk ("Rowan Tommins [IMSoP]") On 19/06/2024 13:33, Erick de Azevedo Lima wrote: > I searched internals and found a discussion from almost a decade ago. > That discussion did not end well, mostly because of insulting accusations. If you're talking about the March/April 2015 thread, I don't think that's a fair summary. There were some slightly ill-mannered comments about the use cases, but mostly even those instinctively against were willing to discuss the details of the proposal. The discussion ended not because of any bad feelings, but because the person proposing it had to put it on pause because of things happening in their personal life, and evidently did not pick it back up again: https://externals.io/message/85779#85985 - Initial thread: https://externals.io/message/84602 - RFC draft thread: https://externals.io/message/85779 - RFC draft: https://wiki.php.net/rfc/static_class_constructor Digging through the archives, I actually found some even older threads, though none of them seems to have reached a full proposal: - 2004 - https://externals.io/message/13183 - 2010 - https://externals.io/message/49435 - 2013 - https://externals.io/message/65078 So, there's definitely desire out there, but also some challenges. A few things look to have come up again and again (other than whether the use cases are justified): - Naming (yay bikeshedding!) - Whether it should be declared the same way as other magic methods, or have special rules (e.g. different syntax, private even though it's called by the engine, error if you explicitly call it) - Exactly when it should run (on class load? on first access?). (Like Ilija, I was also reminded of Nikita's comments on the "new in initializers" RFC, which touch on this point) - Concerns about implementation details and interaction with other features Personally, I'm on the fence. I've never had a particular desire for it myself, and worry that it would be hard to understand or debug exactly when it was triggered, but can see there is both a desire and a precedent. Regards, -- Rowan Tommins [IMSoP]