Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:130713 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 3D7091ADCAD for ; Thu, 30 Apr 2026 07:43:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1777535017; bh=DZ+jo2RTieteaaK/R1PLbphWxSQgAs/jnL0OMF+j0aE=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=bbA/ZgwKidAcA+5TEKw1TxHrS6v4OVORUMV9HM8NO9SJFTnyVWh5HJ+yGHPh33+Iu YFoKk5EHS1xv7UEpyXMJy0czm8ER9t4oB8yKJjZ4B05hqFtiltXepI5jxqBd1xZoR8 od4CpHW/j03kdRjWjl71LM1etz6yiSImzZFbZcyAFcz0dVePin9p7/Oa9GIkrg5I1/ Urb/IveYTsDQy0FjkEBwN/7TzNOALUVJvvSDNeW5tZF0eDjX6Fx/LlBpzYu2IbfK/B dyaVT+OnBAXuQ4T/8P2OLpJI0QEpTizSyBAI32MyWguMRgYwSB56MiKzNcruohhOis oJ592j8t0B4BQ== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 771F61801D7 for ; Thu, 30 Apr 2026 07:43:35 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) 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,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: No X-Envelope-From: Received: from chrono.xqk7.com (chrono.xqk7.com [176.9.45.72]) (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, 30 Apr 2026 07:43:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bastelstu.be; s=mail20171119; t=1777535006; bh=v1xYXYQBiZwlgrclN8zNcRTt4HOxz/xKIqLKkj0P5WA=; h=MIME-Version:Date:From:To:Cc:Subject:In-Reply-To:References: Message-ID:Content-Type:from:to:cc:subject:message-id; b=dBQ9JBwLR328mrxCELv6OMAPDrAHpXPDEhS1TdljvsOQz36+Z+ZUVr436Hn9j4ssr dC+nPvZGpbo8T4Cy8xOWoFxJ5fpYmC5zFjLSNZ8eQ1W+kJbiU9DoreX0t0riVGFdmS KxvnNR/Yfko0JpRfdkq+5UbC3zJn3LeWEZhm0EKvKWf9iDhbYXFj8eddXGBl+USOla k3o4iEMdQUyWswZKh6SeUEwA/BGhyAyyugihDciO5oqEz+4n0ZT/QbIGnipzM8/0ww qytiVfyEaeICphOR20RVNZ3jRccoAFqPfXi8N9eFBbA/sKmU7Ntzo7wPCRrGhNUZao GPpdg+S2mPZ/A== Precedence: list list-help: list-unsubscribe: list-post: List-Id: x-ms-reactions: disallow MIME-Version: 1.0 Date: Thu, 30 Apr 2026 09:43:26 +0200 To: Daniel Scherzer Cc: php internals Subject: Re: [PHP-DEV] Pre-RFC discussion about adding friendship to PHP In-Reply-To: References: Message-ID: <68afbf850e65a3f07e8b922a9fefa0a8@bastelstu.be> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit From: tim@bastelstu.be (=?UTF-8?Q?Tim_D=C3=BCsterhus?=) Hi Am 2026-04-29 19:30, schrieb Daniel Scherzer: > I haven't started work on implementing this yet, but there is a big > question about how to indicate friendship that I wanted to get some > feedback on. Specifically, should it be added with a new keyword, or > with > an attribute? It should be a proper keyword for the reasons that are also mentioned in your blog post: Attributes are not part of the public API and thus do not contribute to e.g. LSP checks. They are also expected to gracefully degrade when they do not exist, which means that running code written with friendship in mind on older PHP versions will silently expose a different API instead of failing in a visible way. See also the reasoning that I provided in the #[\Override] RFC: https://wiki.php.net/rfc/marking_overriden_methods#why_an_attribute_and_not_a_keyword. I think the related mailing list discussion provides additional context - and I seem to remember I wrote something similar in some other RFC discussion as well. Best regards Tim Düsterhus