Skip to content

PHP Fails to Deserialize Date Objects Created in Javascript #127

Open
@doc987

Description

@doc987

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

MessagePack Specification: https://github.com/msgpack/msgpack/blob/master/spec.md

Expected Behavior: Javascript Date is deserialized to PHP DateTime.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions