Open
Description
If a Date
object is created in Javascript (new Date()
), and is serialized with MessagePack, then PHP will fail to deserialize with the following message:
PHP Warning: [msgpack] (php_msgpack_unserialize) Parse error
This happens if the Date
object is by itself, or part of another object. It also happens if the serialization is done with either of the two javascript libraries listed on https://msgpack.org
- https://github.com/kawanet/msgpack-lite: Serializes
Date
as ext 8 (0xc7). - https://github.com/ygoe/msgpack.js: Serializes
Date
as timestamp 64 (0xd7).
MessagePack Specification: https://github.com/msgpack/msgpack/blob/master/spec.md
Expected Behavior: Javascript Date
is deserialized to PHP DateTime
.