Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:129015 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 06DD01A00BC for ; Fri, 31 Oct 2025 08:44:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1761900258; bh=ZB5mEY1u1unbg6xIGaoNhSSJ6bgc0cr3DQ8BZqsel2M=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=dPcIvjnmwxQ0XAgfXI16TwdS/3LbR54ljl00iA1Wz/XB4dfVeyGDmLauubniboklq 1JX7Y3kPdcF5W96mG4VybsIS0+dBwx84udUd56CPFl3TYOPVHfLf6O6G0xlWBAp7+t itLZ7O5SuEcghXWboQBV8Jw7794m69ti1lOQ57i0pLq/JoIsG7SvGouZouP4GoFTLR yIbDaB7xisY5dPTmMAMqUy55GK9vqkIMm0vcj76Tdw2qi1AXZ/pW/C74sxsWOeQaWW G9zwHlEunmgMUUu+nPfNZrUI2kdClTr46EP0HlimJmEzraxpTm0Z1PQduG0fnkl7Ij HdohuQucgOnQg== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 82ECD18007E for ; Fri, 31 Oct 2025 08:44:14 +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, T_SPF_TEMPERROR 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, 31 Oct 2025 08:44:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bastelstu.be; s=mail20171119; t=1761900247; bh=5CbPLCWGia+S+uVOlktHhP0A8vmtdVJOQUaBdIO0IaQ=; h=MIME-Version:Date:From:To:Cc:Subject:In-Reply-To:References: Message-ID:Content-Type:from:to:cc:subject:message-id; b=fBoeqrK5UZjX7xOO4D2qDow8idjLdZEakHCkqG6l31BhRntsVYt1LuZFmKW5oqIkt BUhfVKe7tScvjHXEQcoAj0aBr+XO0MvxRQccW9xNgknvEvbKtp7n08eWRY0Qj/OpqP k8oujSlIMLCtHukBGCGPyKMnfQCfx5UUAN8tM+pi5HZr13Gdq2KIHriPWPzPFdbtGy Ez8kXDd1vt4GuWqN7W4atNK8pbqSUS3QKsde1zlp9/kWWwcoYRrN9UoVhETGQEZcfL XDwyqqBwPX/uvDXPOgKNPVUte3LrnnF/LwJDomDSHfcLEpHeCVgXFaZUoD4hFRk0hR Rsoz2wnFYYGZg== Precedence: list list-help: list-unsubscribe: list-post: List-Id: x-ms-reactions: disallow MIME-Version: 1.0 Date: Fri, 31 Oct 2025 09:44:07 +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> Message-ID: <3a20b5ef66fc23de6bad022685b41190@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-10-30 23:24, schrieb Dmytro Kulyk: > If we go in that direction, I’d suggest keeping the name > #[NoSerialize], because it’s more general and clearly describes the > action rather than the failure mode. > #[NotSerializable] reads more like an error state, while > #[NoSerialize] works naturally for both contexts — skipping properties > silently and preventing class serialization (by throwing). > > This way, the attribute name remains short and declarative, while the > actual behavior (throwing vs skipping) can be determined by where it’s > applied — on a class or on a property — without introducing another > attribute. That makes sense to me and I don't have a suggestion for a better name. Best regards Tim Düsterhus