Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

php BUG #87

Closed
bobrik opened this issue Oct 5, 2011 · 3 comments
Closed

php BUG #87

bobrik opened this issue Oct 5, 2011 · 3 comments

Comments

@bobrik
Copy link

bobrik commented Oct 5, 2011

$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)

@shun0102
Copy link

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)
}

@bobrik
Copy link
Author

bobrik commented Jun 10, 2012

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.

@shun0102
Copy link

Thx!

bobrik added a commit to Topface/msgpack-php that referenced this issue Sep 25, 2012
This is copy of msgpack/msgpack#111 because of msgpack-php split.
Fixes msgpack/msgpack#87 (bug with incorrect packing of mixed arrays).

Patch is pretty straightforward.
@methane methane closed this as completed Mar 4, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants