Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:129130 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 7DF761A00BC for ; Fri, 7 Nov 2025 10:57:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1762513051; bh=KLknOY05pvBYJJ7egDrx5f3yKY8s0tNEC+3OQh4nv0s=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=aIpPLWDrQGjoedA+h/J48aaL0WpRRK2GegUHI0R4c1kxex94nz553o8YHTlwobp1X RYh0r/KrfSLt8xLelSrekkGhG7Vo6nZz0UGPLPNskp0NIsbzt4HMRLOwzvrabJT7/D d4ejbN5uWZElFjSKLdFPtz7MUWlLqi6T5O2LgtYf5nuDlLRNs2JzITGYA9pYCERcef 28JcbtaWlb4OsKVvzHo+iXqD75ne02nzwWu4To0z4KRIXor40C0mqx2HWO8hSbLqFF i+s6H6GjGI9u5lNvPrhnmKesE1EdwHk1mE5FQpdzocMd4LDt9Bq66wEANJR8mnsBfJ CBtzt0FK1gxIw== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id A985518003E for ; Fri, 7 Nov 2025 10:57:29 +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 ; Fri, 7 Nov 2025 10:57:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bastelstu.be; s=mail20171119; t=1762513042; bh=2oxKWeIJeuoT0HKGDBeq1ciFPz1VwA1a965qrZPzZ1o=; h=MIME-Version:Date:From:To:Cc:Subject:In-Reply-To:References: Message-ID:Content-Type:from:to:cc:subject:message-id; b=XJ+ZG5LODREnYUOnd4UQlV96cZTRpqlftRUAe652QCK3qXJBBki+1a6uiW8FEF4Oo zvFUvUMGEFNWrSIvPTO4uiiZMReuFbRmaE6EdxzchZRe4yYqrZu6E7ncKNXZNUBROK J09LS2cukTqEyMehC2O3zy+hW7UW0qr/tY/8sXMTQI2cNgxI4BugUKJSpuvJRplwrL 9c86EWcEqXY+xcgYqMDVUVKnLekk+UwwIgQIo6nx1rND+jmlXvTHfdceTkkdlIXbt4 SKTY2ymXUICQKMbFBjsHmUGYCQcF8FwlFyW0Ux7zurYKM2mTbrr9RswzwIDjklvnLg eRVvK7r+VouCA== Precedence: list list-help: list-unsubscribe: list-post: List-Id: x-ms-reactions: disallow MIME-Version: 1.0 Date: Fri, 07 Nov 2025 11:57:22 +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> <21ff8dee5016a1b7ecc412c44233abd1@bastelstu.be> <3a20b5ef66fc23de6bad022685b41190@bastelstu.be> Message-ID: <4e3061bfaa5218309041460d31be2856@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-11-07 01:13, schrieb Dmytro Kulyk: > I’ve updated the RFC to include the new class-level behavior — > applying #[NoSerialize] to a class now forbids its serialization by > throwing, using the same internal mechanism as built-in > non-serializable classes (e.g., CurlHandle, Random\Engine\Secure). > > This update aligns the proposal with existing engine semantics and > unifies both property-level skipping and class-level prohibition under > a single attribute. > The inheritance model has also been clarified: class-level > #[NoSerialize] is inherited (“sticky”) and cannot be overridden in > subclasses. > > Updated RFC: > https://wiki.php.net/rfc/no_serialize_attribute Thank you. The updated RFC is looking good to me. I also appreciate that you kept a changelog within the RFC. One thing you could mention and that should be done as part of the RFC is migrating all existing classes with `@not-serializable` to make use of the attribute instead. That's also what has been done when the `#[\Deprecated]` attribute was introduced. Other than that, I don't have any further comments. Best regards Tim Düsterhus