Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:126389 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 2B66D1A00BC for ; Thu, 13 Feb 2025 14:16:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1739456054; bh=SEa5J2xNvdj69dBdaUG4HiI26yibwVgyZba0ITzY8Mc=; h=Date:From:To:Subject:In-Reply-To:References:From; b=mKEKTs46yDY2jRmpmeljLMgqj8r8k36s25IcziNuMjsx1/Z1c6aIVwZ0ylgYRzqnu 9eppUtu03fggBeAcG0bsL3IydPEBTslMENWGCVnBQkUraU+vR/wG/ey+90rqcVPWWf dYMnthrg3BoG0rsEFdNJVP598bwTxUajq7cxqnZ0Jj1zLxDK364Fjm/xoSCZQvIZaa dWkKMuoCbS9sNiiNZgZ8DDWAAVlKg4FfyGRyBab3QDEKXJZd8RaUmetVL5umzKMSTY cQij7M0X+D5uysHr8yvr0WZ8b1txRUQzYDcywaHtdAj49x/QZVuPBP4MHRuhF9RrFV +z1zjH3/ZVQ1w== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 297D9180087 for ; Thu, 13 Feb 2025 14:14:13 +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.2 required=5.0 tests=BAYES_40,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.0 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, 13 Feb 2025 14:14:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bastelstu.be; s=mail20171119; t=1739456213; bh=ii0rXDE0MFgI6qP+/McDP1Fo/AkV8hJE40J8PMmtVuM=; h=MIME-Version:Date:From:To:Subject:In-Reply-To:References: Message-ID:Content-Type:from:to:cc:subject:message-id; b=W9lQXcS0I/OG1Gxo8G1JmE46fsV1AlH/L1hupCwuoOr4GGnMSe7ZX9EmTgC3kP+9B WSpLem3qzb9UVEIb4ZkZoHMHq+qtXT+lC8r+thtnjiUTOjXJFPlBjVqU/TRhPrnmKi AcumQG3Jhxf63qXO4TKp34gRb5AtXOfXNqu8awCs2AOXVg7Kke5X0x6pFA2gC5UnFm 3Kw9cJKcre4JpD5tHfE0q8ut1iYTrFcnOtD/q205S/vNqoVCBMS7qqt2PXfBC3PGoW q90nL+7bwPZ8zIGZd1cOaUtmAas8FXYQhWz0pdOVOGHFWqTcMiRx6apxSqUBuTG64T SpfHULKNEuQfA== Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 Date: Thu, 13 Feb 2025 15:16:52 +0100 To: internals@lists.php.net Subject: Re: [PHP-DEV] Re: RFC: Marking return values as important (#[\NoDiscard]) In-Reply-To: <3d188924-33cf-4c3b-b7ff-3bd29232f16a@app.fastmail.com> References: <3d188924-33cf-4c3b-b7ff-3bd29232f16a@app.fastmail.com> Message-ID: <386df71fdd6818ddd54c771a889b7d5d@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 2025-02-12 22:31, schrieb Larry Garfield: > I'm still undecided on the RFC overall, but one thing that is > problematic is the phrasing of the messages. Currently, the messages > in the attribute are fragments of an English sentence, seemingly > designed to fit grammatically with a sentence fragment that is coded > into the engine somewhere but not readily available to developers. Yes, the implementation of the error message very closely matches that of #[\Deprecated] (except that there is no `since` bit to insert). > From my phrasing I think you can guess my opinion of that. > > That is impossible to document cleanly for English speakers. It will > not translate at all for anyone who is writing in a non-English > language (which people do). People are going to get it wrong more than > they get it right, in any language. > > Instead, the wording should be structured to be a complete sentence, > and the built-in message updated to make that logical. That gives the > developer much more freedom to write a meaningful, > contextually-relevant message in the language of their choice. We're open to adjusting that. Do you have any suggestions? The implementation of #[\Deprecated] works like it does, because PHP itself already doesn't end the error messages with a `.`, as it appends `in file.php on line 42`. This makes it inconvenient to have more than one sentence in an error message, which is why we're struggling with coming up with something better. Best regards Tim Düsterhus