summaryrefslogtreecommitdiff
path: root/php/test_normal.php
blob: ee348c292ae77f348125fdbaaad2113bc851c274 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<?php
 //$data = array(array(null=>1), array("takei"=>"hide"), 3);
 //$data = array("more"=>10, "test", null);
 //$data = array();
 $data = array(0=>1,1=>2,2=>3);
 var_dump($data);

 // serialize
 $msg = msgpack_pack($data);

 // hexadecimal
 $str = unpack('H*', $msg);
 var_dump("0x".$str[1]);

 // deserialize
 $ret = msgpack_unpack($msg);
 var_dump($ret);
?>