Hi

On 9/20/22 21:24, Tim Düsterhus wrote:
My understanding is that this attempts to gracefully handle broken cache
entries and force a rebuild if the payload is invalid.

This will fail if the serialized payload contains a malformed
DateTimeImmutable, because DateTimeImmutable will throw an Error,
instead of Exception: https://3v4l.org/eB5ZE. The 'catch' should likely
be adjusted to catch '\Throwable'.


To add onto this: "An Error could be thrown" might also happen with a PHP 8.2 readonly class that later removes a property. As the property no longer exists on the class it will be considered a dynamic property which is disallowed on readonly classes, thus throwing an 'Error', not 'Exception' during unserialization:

https://3v4l.org/Xsmfu

Best regards
Tim Düsterhus

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: https://www.php.net/unsub.php

Reply via email to