Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:126406 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 A32941A00BC for ; Fri, 14 Feb 2025 11:57:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1739534062; bh=iAvz2TzCuASegoL36/uEl7WQg7x54IfCFK3yHwZqN8k=; h=Date:From:To:cc:Subject:In-Reply-To:References:From; b=PXcdDJnOP0jyvzELCRCDov09G0PgYpWaojiQ5SQaeIkSk3Hgj7gREFgDrtYF0FlrK ZrpuPvQZbCokSBTz/X45vNa/FlPzOAAPBbxWIzUhX0fVf3mgwTxwPYjOvgt+6V+v/J lj1grtULPWFfO0JdahwzJZ5p76mfjFv8dRDvbBoAkr4vQ/92g/byp4xTVoe6Aa0Hjz EmCuIGJ118YrUVGP0nG10RlANhHQiO9dYqzezBUItTwP5JZCXHZin7/vr9t5v4aM5T ZbM1d4sTQiZ7TPHWNevDIIcRqNQtvPx8oPUtSu+bR0I1Kls8Ki4NU6oVsDKct9eEkV Beg5sNaD9jJxw== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 3CDDB180086 for ; Fri, 14 Feb 2025 11:54:22 +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=3.6 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,SPF_HELO_PASS, SPF_SOFTFAIL autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from xdebug.org (xdebug.org [82.113.146.227]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Fri, 14 Feb 2025 11:54:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1739534223; bh=iAvz2TzCuASegoL36/uEl7WQg7x54IfCFK3yHwZqN8k=; h=Date:From:To:cc:Subject:In-Reply-To:References:From; b=AYO6CjsOqUXvJYkrVprQyK6/7Z/uWMcMxrcm9IMnEyDyhhKiavrHCQYiBhAgHhk66 W5kx6dnz3jYLexNZ9umNe6S7X//QrJwGfogFHf50DFvK0g4/w0jDXKSSZYsKPwiZ9z j6zUzqnwpG0ZmZPwtbXg8Ftriq5/bC5iYuheldiKwjDrJlcDCRO5XQQgdCVcW2WjGI clQ8gb7ukCdAZI+eXa7xuX17u+ngfynAlr2w73C0dkgQcu5vSADYteV6FrkZCQ7BOt bTB0LBMD6KV+MgFnJEzKZ973ANxR2xCTLSu9aMH06ieMPyAIYpE9JXmDgWK8cO07XJ o3VSiKmlG9TFg== Received: from localhost (localhost [IPv6:::1]) by xdebug.org (Postfix) with ESMTPS id 0537710C087; Fri, 14 Feb 2025 11:57:02 +0000 (GMT) Date: Fri, 14 Feb 2025 11:57:02 +0000 (GMT) To: =?UTF-8?Q?Tim_D=C3=BCsterhus?= cc: Jakob Givoni , volker@tideways-gmbh.com, internals@lists.php.net Subject: Re: [PHP-DEV] Re: RFC: Marking return values as important (#[\NoDiscard]) In-Reply-To: Message-ID: <8f0f99bf-70c3-c150-71b5-6b4760b72709@php.net> References: <5c142df3-94f8-45ba-b5c6-af3b4f7caa8b@varteg.nz> Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="8323329-1786628913-1739534223=:13815" From: derick@php.net (Derick Rethans) This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323329-1786628913-1739534223=:13815 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE On Thu, 13 Feb 2025, Tim D=C3=BCsterhus wrote: > Am 2025-02-13 09:16, schrieb Jakob Givoni: > > > Attributes were added as a structured replacement for docblock props=20 > > and I don't like it when they affect how a program actually runs (as=20 > > long as you're not using reflection). >=20 > Excluding the `#[\Attribute]` attribute, PHP currently has 5 native=20 > attributes and they all affect how the program runs. The initial=20 > accepted Attribute RFC even lists several =E2=80=9Cbehavior-affecting=E2= =80=9D=20 > attributes in the =E2=80=9CUse Cases=E2=80=9D section:=20 > https://wiki.php.net/rfc/attributes_v2#use_cases. It is probably fair=20 > to say that use-cases like `#[\NoDiscard]` do not go against the=20 > vision intended by the Attribute RFC. >=20 > You could think of it as the PHP engine using Reflection internally to=20 > do something differently. I don't agree, but for a different reason. None of the current attributes (ReturnTypeWillChange,=20 AllowDynamicProperties, SensitiveParameter, Override, and Deprecated)=20 change the behaviour of how a program runs. They only add warnings. with=20 the exception of AllowDynamicProperties to be an actual 'feature' in PHP=20 9.0 (now it's only a deprecation warning silencer). That's the same with this suggested NoDiscard, it doesn't change how a=20 program is run =E2=80=94 it merely adds a warning. cheers, Derick --8323329-1786628913-1739534223=:13815--