1--TEST--
2Issue #83 (Arrays and negative index)
3--SKIPIF--
4<?php
5if (!extension_loaded("msgpack")) {
6    die("skip");
7}
8?>
9--FILE--
10<?php
11
12var_dump(msgpack_unpack(msgpack_pack([-1=>-1,1=>1])));
13
14$a = [
15    -1 => -1,
16    0,
17    1 => 1,
18    2
19];
20// next free element == 3 and count() == 3, but it's still not an MP array
21unset($a[1]);
22var_dump(msgpack_unpack(msgpack_pack($a)));
23
24?>
25OK
26--EXPECT--
27array(2) {
28  [-1]=>
29  int(-1)
30  [1]=>
31  int(1)
32}
33array(3) {
34  [-1]=>
35  int(-1)
36  [0]=>
37  int(0)
38  [2]=>
39  int(2)
40}
41OK
42