Hello Rob,

I think it would be good to list these non-serializable objects in the RFC.
> It doesn't have to be exhaustive, but the list includes throwables,
> weak-maps, weak-references, closures, fibers, etc. Some people may be
> relying on this behavior (and I'd be curious to know that use case myself).
>

Thank you for your note. As I went through to the code-base in order to
compile the list for the RFC, it also occurred to me that all anonymous
classes are marked as ZEND_ACC_NOT_SERIALIZABLE, but json_encode()-ing such
classes is unproblematic and probably very much desired for user land
classes.

I have updated the RFC and attached implementation to allow anonymous
classes to be json_encode()’d, provided their parent class is not marked as
ZEND_ACC_NOT_SERIALIZABLE.

Thank you very much

Philip

Reply via email to