Re: [RFC] More Appropriate Date/Time Exceptions
| From: | Tim Düsterhus | Date: | Thu, 08 Dec 2022 15:05:38 +0000 |
| Subject: | Re: [RFC] More Appropriate Date/Time Exceptions | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-119101@lists.php.net to get a copy of this message | ||
Hi
On 12/8/22 15:11, Dan Ackroyd wrote:
None of the 'Invalid serialization' errors tell the programmer who reads them what is wrong with the data. Unless the code was written in such a way that the data was in (and was logged) in the callstack, that would be a bit frustrating as someone might need to do quite a bit of work to find the data that was triggering the problem. Changing those to be specific error type, that included a method of 'getBadData' could make it easier to fix those issues.*Strong* disagree, because: https://wiki.php.net/rfc/improve_unserialize_error_handling. We should not make it easier for developers to programmatically shoot themselves in their feet with unserialize(). If your data fails to unserialize, the only safe option is to throw it away. Best regards Tim Düsterhus