Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:129005 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 9DB931A00BC for ; Thu, 30 Oct 2025 08:23:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1761812594; bh=EjeNnpBmIPTr7l1ApPYNHC3Y2DkNKRVtwwM8+Hg9RWk=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Gj2hA9J3I1tBx1CDOurycXXW+LXniOOYOhSM5JvWeTAMqSYZjGPPP+0vN0oy/dBfy d/plI9Fax9NxexYPsS88ezXRmxHYaF1aYic3q6nxs0O61Q1tElG2F1TcplsxwHIbN/ JrZgj/7MvX/LGActpjs4sWXydbO2vNVov4jd2YUtF69rl8e6XOc7zdw4FEZuRwMtZk CwrjoGG0vkBSaL/4L9E9TUT1+SMxS9kIK17GjwKa5tcSS2bkjFAtgEo/3lO7YdwNK7 I8PkhJ4Xim4MH3y/P1/cgl9h0IvmIze2CVwIf5qFpuffOMASoIA9LZ/Wnv6wla7tVa HZcbTqOxM5s9Q== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 2AA331801E8 for ; Thu, 30 Oct 2025 08:23:12 +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.2 required=5.0 tests=BAYES_20,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 Oct 2025 08:23:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bastelstu.be; s=mail20171119; t=1761812583; bh=qZFN0QhB7mlIbxLy13fvigGZ+HSJyD4a+2j4yNKwX6Y=; h=MIME-Version:Date:From:To:Cc:Subject:In-Reply-To:References: Message-ID:Content-Type:from:to:cc:subject:message-id; b=dfJRRzH8yta6BXRSj64gpjaoLxLYubxNWtUrEk+D+AVRvCzy0ass4jZ2ki5SmzRJE iMYmwJRN+Q36hWMMR+VtzJCM6zH0qIa6dPNmwO6tYCHGsn1BaBegJdnCtN8WpNtpkH ttscHTuYh7wCMl7MavRnUyM4drvAdzhC0cr7pqe9qYX7lPY1MOmcF7soQsm9WXj6c8 fCmpTsZHdkCkXUluyHT0+/U9+9TUJ4xJZVUE2hqneOsLtbD5GIUp7IrdKanrLAfRX6 cEHVj7oPgqicbXNxe6q+xRPcDa4z76EVp+o0EGJbwYYY8S8iKeYVq+qFgk6sy2ilxX MPgh7URToqp9Q== Precedence: list list-help: list-unsubscribe: list-post: List-Id: x-ms-reactions: disallow MIME-Version: 1.0 Date: Thu, 30 Oct 2025 09:23:03 +0100 To: Dmytro Kulyk Cc: Ilija Tovilo , PHP internals Subject: Re: [PHP-DEV] [RFC][Discussion] Add #[NoSerialize] attribute for excluding properties or classes from serialization In-Reply-To: References: <4b6abc36d8ab6cd306e95141869db3b0@bastelstu.be> Message-ID: <21ff8dee5016a1b7ecc412c44233abd1@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 I am just noticing that your RFC still is marked as Draft, both within the RFC text and within the overview at https://wiki.php.net/rfc. Don't forget to adjust the status to “Under Discussion” for proper visibility. Am 2025-10-29 23:23, schrieb Dmytro Kulyk: > It already makes no sense because the class-level attribute will be > excluded from the RFC, and I have no plan to add something like this > to #[NotSerializable]. It may be added in a future RFC. I am seeing that you adjusted the RFC to remove the support for applying `#[\NoSerialize]` to classes. Given that we determined that serializing classes should either throw or work (i.e. that serializing them to `null` is never right), I don't think that two separate attributes are necessary. While a combined attribute would behave somewhat differently for classes and properties, the name of `#[\NoSerialize]` and `#[\NotSerializable]` is very similar and thus confusing in itself. I would suggest to merge the RFCs of `#[\NoSerialize]` and `#[\NotSerializable]` into a single attribute, since in both cases you are indicating “I don't want this serialized” and I think it is reasonable to expect from users to learn that there is some difference in behavior for properties compared to classes. Best regards Tim Düsterhus