On Fri, Oct 31, 2025, 4:47 AM Tim Düsterhus <[email protected]> wrote:
> 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. > 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". >
