Let's say, for fun, I have good reasons to serialize an object. When I then have good reasons to unserialize that object, I'm getting dynamic property deprecation warnings. Is this just the way of the world now or is there something I'm missing? I don't "own" the class, so I can't easily mark dynamic properties as allowed before serializing (and I'm not even sure that would work).

@EdGrosvenor *could* you own it?

#[AllowDynamicProperties]
class mine extends theirs { }

(or adding the property)

and then using your copy only?

but also yes iirc only stdClass or those with __get/set is gonna be silent about it.

@bobmagicii maybe. But the warning seems to be talking about numeric properties that don’t exist on the class at all. Might be a side effect of serializing and unserializing. So I’d be adding properties that don’t exist for no really good reason. I’m wondering if I can get a better result using the symfomy serializer and taking a bit more control over what the stored object looks like.
@bobmagicii It seems like the right solution would be to just store the values of the properties as json and then new up the class when I need it back and hydrate it. But there are no convenience methods (toArray, etc) to make that easy.