RFC: Improve unserialize() error handling#9425
Conversation
|
When we are making this step, I think we should make it completely consistent - either unserialization can fail with exception or have warnings and gracefully handle that. But I don't think we should have some modes throwing and some modes warning. Doesn't make too much sense to me, especially given that unserialize is supposed to only ever come from trusted contexts with data which should never be invalid. |
Yes, I absolutely agree here and would love to change all the warnings / notices during unserialization to an Exception. FWIW: A throwing error-handler would result in UnserializationFailedException with this PR. So this is primarily about the users who don't use one. |
598498d to
ab91b5d
Compare
ab91b5d to
b117209
Compare
RFC: https://wiki.php.net/rfc/improve_unserialize_error_handling
Discussion: https://externals.io/message/118566
Pre-RFC discussion: https://externals.io/message/118311