Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:126399 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 C615B1A00BC for ; Thu, 13 Feb 2025 22:29:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1739485598; bh=PiIPM9oxtg5FBYNnkVeByGIUG1+KPRVUFmbopsuOljw=; h=Date:From:To:In-Reply-To:References:Subject:From; b=H004DT4BsaGjS0wad7OeR5FSjq7cE82h1yxaSUmruewm4G3zjqtKuUSWfI1wip6R4 0w2XgaKe+3wm9L5sukMmI5Dy6gR36X26woUQSuYMaJLuub41gm1SkKPTvV5g4+8h5Z v01I3eKSaUWUAlifp6dgBWCRi0huk9UOpNkU7KqhVdGJZ/4qHRBBkmyqlVzjKcjCA1 sEPyX0ninvaavA3W9OCbwMnlGJO0yHGfiOhZ5674BpyImH8kHlUujIYIgkrh/JPyMi 6DzBW2kV/K8ujwYaeGVJWwsQMp85aH1X6LXbjdMjrNbKUV9mmcmFaDrCFUG47TYsnD 3lCy+Zp3xl7UQ== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 08CFB180068 for ; Thu, 13 Feb 2025 22:26:38 +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.9 required=5.0 tests=BAYES_20,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_MISSING,RCVD_IN_DNSWL_LOW, SPF_HELO_PASS,SPF_NONE autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from fhigh-a2-smtp.messagingengine.com (fhigh-a2-smtp.messagingengine.com [103.168.172.153]) (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 22:26:37 +0000 (UTC) Received: from phl-compute-10.internal (phl-compute-10.phl.internal [10.202.2.50]) by mailfhigh.phl.internal (Postfix) with ESMTP id BE43311400FA for ; Thu, 13 Feb 2025 17:29:19 -0500 (EST) Received: from phl-imap-06 ([10.202.2.83]) by phl-compute-10.internal (MEProxy); Thu, 13 Feb 2025 17:29:19 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= garfieldtech.com; 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=fm3; t=1739485759; x=1739572159; bh=EXQbSnbnN7WUGCGrwRgJS b1WdMJSg7feJYyZz4VvB8M=; b=FQPdP5kViIVsmnEtxQIq7CojFeZQiuLd2hqYe OtnfWuSh6qe+nM16cfB2sT2iuVxpuHTy/SE3pSfBk1L9Y8RacvMDXIujO8WSwR9R yWmTo8gfEMQwdNU81apBkA9Oprij+uztCMx6oPfFvfMn0T+1ZdloMZbwoS0Q/gEu TxdJMa98Cx9vNcECUz/acZOUX+xa6lLTKsRn8Xr+nBOg54BVSf7wqoHkO00G0kA7 DHtubelv1bnAk9tXc+AINKCjjaD82+Oi9JdQKaAom+D0T/W6aNMEBpU1xqEazjkt JKjjvoIbFDV6Ef2CISa7lYfnVUyCtm4sMg387G+EW44xy3ssQ== 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-sender :x-me-sender:x-sasl-enc; s=fm3; t=1739485759; x=1739572159; bh=E XQbSnbnN7WUGCGrwRgJSb1WdMJSg7feJYyZz4VvB8M=; b=EEPFsLo1pV1KrKHC/ sOJ3nYAFY+0vio6Tsw7xA/7ZrcYGqv3358bcnvI5c9E+0QyIRchHjb4dmFOFsCL0 AlikLph2aBg8zdEgHU5s4Vm/YsV0u5u0ZPb+hvrVh/VNcxJBudWrZXKjl4c4WhFh IG8r7/CvGvpNXWxwMQkLAgHMryhINUxFeTJvdo34TUigMRI6LZUv7dhqhSNsZKiZ Mth6mTMD3BCR+EqD68OEltz6jTWut1fNCdct0X79uK9nWa0HAsTydC5xGSmBLur2 gjJoMqtLBJbVVLG9idBYfU5oZKxuxS9hqeJFdUqMotIf/hXqpXRSD0NXLvZvL24/ XQ8mA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdegjeeljecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivg hnthhsucdlqddutddtmdenucfjughrpefoggffhffvkfgjfhfutgfgsehtqhertdertdej necuhfhrohhmpedfnfgrrhhrhicuifgrrhhfihgvlhgufdcuoehlrghrrhihsehgrghrfh hivghlughtvggthhdrtghomheqnecuggftrfgrthhtvghrnhepffeiiedvhfdvgedutddt geetieeugeevhfetheeffeefteduiedthedtgeejueeinecuvehluhhsthgvrhfuihiivg eptdenucfrrghrrghmpehmrghilhhfrhhomheplhgrrhhrhiesghgrrhhfihgvlhguthgv tghhrdgtohhmpdhnsggprhgtphhtthhopedupdhmohguvgepshhmthhpohhuthdprhgtph htthhopehinhhtvghrnhgrlhhssehlihhsthhsrdhphhhprdhnvght X-ME-Proxy: Feedback-ID: i8414410d:Fastmail Received: by mailuser.phl.internal (Postfix, from userid 501) id 6CB5529C006F; Thu, 13 Feb 2025 17:29:19 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface 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 16:28:59 -0600 To: "php internals" Message-ID: <374661dc-5193-4787-af4d-89cf2b983e15@app.fastmail.com> In-Reply-To: <386df71fdd6818ddd54c771a889b7d5d@bastelstu.be> References: <3d188924-33cf-4c3b-b7ff-3bd29232f16a@app.fastmail.com> <386df71fdd6818ddd54c771a889b7d5d@bastelstu.be> Subject: Re: [PHP-DEV] Re: RFC: Marking return values as important (#[\NoDiscard]) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: larry@garfieldtech.com ("Larry Garfield") On Thu, Feb 13, 2025, at 8:16 AM, Tim D=C3=BCsterhus wrote: > Hi > > Am 2025-02-12 22:31, schrieb Larry Garfield: >> I'm still undecided on the RFC overall, but one thing that is=20 >> problematic is the phrasing of the messages. Currently, the messages=20 >> in the attribute are fragments of an English sentence, seemingly=20 >> designed to fit grammatically with a sentence fragment that is coded=20 >> into the engine somewhere but not readily available to developers. > > Yes, the implementation of the error message very closely matches that=20 > of #[\Deprecated] (except that there is no `since` bit to insert). > >> From my phrasing I think you can guess my opinion of that. >>=20 >> That is impossible to document cleanly for English speakers. It will=20 >> not translate at all for anyone who is writing in a non-English=20 >> language (which people do). People are going to get it wrong more th= an=20 >> they get it right, in any language. >>=20 >> Instead, the wording should be structured to be a complete sentence,=20 >> and the built-in message updated to make that logical. That gives th= e=20 >> developer much more freedom to write a meaningful,=20 >> contextually-relevant message in the language of their choice. > > We're open to adjusting that. Do you have any suggestions? The=20 > implementation of #[\Deprecated] works like it does, because PHP itsel= f=20 > already doesn't end the error messages with a `.`, as it appends `in=20 > file.php on line 42`. This makes it inconvenient to have more than one=20 > sentence in an error message, which is why we're struggling with comin= g=20 > up with something better. > > Best regards > Tim D=C3=BCsterhus Just spitballing: "Return value of foo() is not used, on foo.php line 5: " Fiddle with the wording as needed, but by having a colon and then the us= er text, it makes it clear it's a separate statement, and can be as flex= ible as a statement in your chosen language wants to be. --Larry Garfield