Skip to content

Return on unserialization #8

Closed
Closed

Description

@chaosue

It returns an unexpected value and issue an E_WARNING when the string is unserializable .
It will be more clear if returns FALSE in this situation, so we will know if the string is successfully unserialized. It will be much better if it throws an exception , since even a serialize FALSE can be unserialized to FALSE.

Activity

  1. marc-mabe commented on Oct 23, 2012

    @marc-mabe

    I would prefer adding an optional argument (by reference) that shows the success status

    $unserialized = msgpack_unserialize($serialized, $success);
    if ($success) {
        // SUCCESS
    } else {
        // ERROR
    }
    
  2. added a commit that references this issue on Feb 19, 2013
  3. laruence commented on Feb 19, 2013

    @laruence
    Member

    fixed

  4. laruence commented on Feb 19, 2013

    @laruence
    Member

    about the second argument, we can add a msgpack_get_last_error instead like json does

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions