Re: [RFC][Discussion] Add #[NoSerialize] attribute for excluding properties or classes from serialization
| From: | Tim Düsterhus | Date: | Fri, 31 Oct 2025 12:23:17 +0000 |
| Subject: | Re: [RFC][Discussion] Add #[NoSerialize] attribute for excluding properties or classes from serialization | ||
| References: | 1 2 3 4 5 6 7 8 9 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-129025@lists.php.net to get a copy of this message | ||
Hi
Am 2025-10-31 13:16, schrieb Eric Norris:
I hope I'm not starting a bikeshed discussion, but I've been following along - can I suggest "DoNotSerialize"? "NoSerialize" sounds odd to me, whereas "DoNotSerialize" can be seen as both an instruction to PHP - "don't serialize this property when serializing the class" - and an instruction to developers - "do not attempt to serialize this class".I don't have a particularly strong opinion on naming, but I'd like to note that #[\NoSerialize] is in line with #[\NoDiscard] (added in PHP 8.5, https://wiki.php.net/rfc/marking_return_value_as_important). Best regards Tim Düsterhus