Skip to content

php BUG #87

Closed
Closed

Description

@bobrik
$data = array(
    "flags" => array(
        0 => 16777216,
        2 => 4
    )
);

$data['flags'][1] = 65536;

var_dump(msgpack_unpack(msgpack_pack($data)) == $data);

keys became random. also happens if there are arrays like array('ley' => 2, 2 => 1, 1 => 3)

Activity

  1. shun0102 commented on May 28, 2012

    @shun0102

    I got the same problem.

    $data = array('key' => 2, 1 => 3);
    
    var_dump($data);
    var_dump(msgpack_unpack(msgpack_pack($data)));

    In my case, not just keys became random, but also keys was corrupted.

    $ php msgpack_test.php 
    array(2) {
      ["key"]=>
      int(2)
      [1]=>
      int(3)
    }
    array(2) {
      [0]=>
      NULL
      [1]=>
      int(3)
    }
    
  2. bobrik commented on Jun 10, 2012

    @bobrik
    Author

    Good news everyone: I made pull request to fix this bug.

    If you want it now, you may checkout my branch (php-fix) and rebuild module yourself.

  3. shun0102 commented on Jun 11, 2012

    @shun0102

    Thx!

  4. added a commit that references this issue on Sep 25, 2012
    deccffa
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions