1--TEST--
2Check for simple string serialization
3--SKIPIF--
4--FILE--
5<?php
6if(!extension_loaded('msgpack')) {
7    dl('msgpack.' . PHP_SHLIB_SUFFIX);
8}
9
10function test($type, $variable) {
11    $serialized = msgpack_serialize($variable);
12    $unserialized = msgpack_unserialize($serialized);
13
14    echo $type, PHP_EOL;
15    echo bin2hex($serialized), PHP_EOL;
16    var_dump($unserialized);
17    echo $unserialized === $variable ? 'OK' : 'ERROR', PHP_EOL;
18}
19
20test('empty: ""', "");
21test('string: "foobar"', "foobar");
22?>
23--EXPECT--
24empty: ""
25a0
26string(0) ""
27OK
28string: "foobar"
29a6666f6f626172
30string(6) "foobar"
31OK
32