Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:123776 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 AD9DE1A009C for ; Mon, 24 Jun 2024 07:53:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1719215701; bh=HA+05RkNb5Qj+PoCtNZqIDnDR1RZw4Y1PkrPznadNH0=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=b9RnUXNZE+qFjc+alrPqan8HHMh0QGh79Rx/KIcvV9q8xcHOUafzS38PUJKtssj8W +PSuISZwse0LqpSOy/kVNpaEl6lVIs3LaOO4FgNCbje2/RTh7RVATYZJuyD85rqZ+G 6B5oBE3uHJMHNR4/1G1aFsfuiY29P038z7nuZMhd1XmF3htbSwDU8IPOu8l9zYN41i KnuzEqYo06TvQ1shV6kH4k2ep1Yvt937ESNaWqRR/sYJUHOrgJkq+kq1R2/FHKjdLB UZY9o8xbeWPTopFtTVzUYnCa/t466JJUW6Bn+l2jedAq/j/fEiUKhUKDvv0dp5yKw+ HMhvqcvoZN10Q== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 3817E18069D for ; Mon, 24 Jun 2024 07:54:59 +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.6 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,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 forward501b.mail.yandex.net (forward501b.mail.yandex.net [178.154.239.145]) (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, 24 Jun 2024 07:54:58 +0000 (UTC) Received: from mail-nwsmtp-smtp-production-main-57.myt.yp-c.yandex.net (mail-nwsmtp-smtp-production-main-57.myt.yp-c.yandex.net [IPv6:2a02:6b8:c12:348a:0:640:f4fa:0]) by forward501b.mail.yandex.net (Yandex) with ESMTPS id 9E1B7618FC for ; Mon, 24 Jun 2024 10:53:39 +0300 (MSK) Received: by mail-nwsmtp-smtp-production-main-57.myt.yp-c.yandex.net (smtp/Yandex) with ESMTPSA id crIcS90oG4Y0-5oAXVEQI; Mon, 24 Jun 2024 10:53:39 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=php.watch; s=mail; t=1719215619; bh=HA+05RkNb5Qj+PoCtNZqIDnDR1RZw4Y1PkrPznadNH0=; h=To:Subject:Message-ID:References:Date:From:In-Reply-To:Cc; b=kzc493c9oI+uDFiFyidshnPILMdgI/MB1OB4CHXqEN5PdO33fNqIr7SjcrKJHa1Gq nz3Da+Gn6yEkbeY/MDUa1V545cJF06nxkNP5fiPFnXYI8PTg32tQl6+Ji6oov/8thm VJCv/EUyHWhG7dkyZ7gh2IrN16K7P2eLxmkzAYrU= Authentication-Results: mail-nwsmtp-smtp-production-main-57.myt.yp-c.yandex.net; dkim=pass header.i=@php.watch Received: by mail-ej1-f51.google.com with SMTP id a640c23a62f3a-a724a8097deso94084666b.1 for ; Mon, 24 Jun 2024 00:53:38 -0700 (PDT) X-Gm-Message-State: AOJu0YwDcl0tw7Irw1jNVeHtAzDRPQuv10UfPtWVLelz/eHCOyHEq2W8 V/61KD45GXpI7D42niQT9jshGqCbDg3gCgqnFfkdDvaNHXVWq+YQAeWWkGrK7+DgZ1aVFaKUPl5 br/7X6jXYygvfQnCZEV6ykPyZJb8= X-Google-Smtp-Source: AGHT+IHkHPlxoTrJIMVt5xWFuHdrx1t53BGFCpqW4jK1ran4jq41V6byvQT5EPJGdoEzzF+dAGCH1G5pfGWMcfV57Oo= X-Received: by 2002:a17:907:d40b:b0:a6f:2294:f90a with SMTP id a640c23a62f3a-a7242da6aa1mr248735566b.57.1719215618467; Mon, 24 Jun 2024 00:53:38 -0700 (PDT) Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net MIME-Version: 1.0 References: In-Reply-To: Date: Mon, 24 Jun 2024 14:53:12 +0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PHP-DEV] [RFC] Static class To: Bilge Cc: php internals Content-Type: text/plain; charset="UTF-8" From: ayesh@php.watch (Ayesh Karunaratne) > > This work is based on the previous discussion thread on this list of the > same name, and hopefully captured all the relevant details, > notwithstanding anything unanticipated that may present itself during > the implementation. Let me know if you feel anything important has been > missed. I am aware it omits to mention specifics about messages so > emitted when runtime or compile-time errors occur, but I anticipate this > can be hashed out in the PR, unless consensus indicates otherwise. Hi Bilge, I was reading the mailing list discussions, and I am glad you created the RFC. Personally, I think this will be a useful feature. Just like we have `readonly` properties and `readonly` classes, I don't see why we can't have static methods. I also saw in the draft PR that it does not require a lot of changes to the engine to have this. I'd like to propose to add some more information and points addressed in the RFC. This is of course merely a suggestion, but it's something I was thinking when reading the RFC. - Why is it a class-level flag and not an attribute (similar to the `#[Override]` attribute in PHP 8.3) ? - Can a subclass extend a static parent class without using the `static` keyword in the subclass? This will avoid a lot of BC issues if a library decides to declare classes as static. - Are there any opt-out mechanisms for subclasses? - Can you mark interfaces, abstract classes, and Enums as static?