summaryrefslogtreecommitdiff
path: root/php/test_normal.php
diff options
context:
space:
mode:
authorHideyuki TAKEI <takehide22@gmail.com>2010-04-05 00:10:28 +0900
committerHideyuki TAKEI <takehide22@gmail.com>2010-04-05 00:10:28 +0900
commit99a2d2859269ddf803a802c043babcd977260faf (patch)
tree5d0a89a77fab9f3c81dbcf49ef5696ef6d3b1f26 /php/test_normal.php
parent254ee80c16b3b0ce12b461d189aa1e6302debea0 (diff)
downloadmsgpack-python-99a2d2859269ddf803a802c043babcd977260faf.tar.gz
import MessagePack for PHP
Diffstat (limited to 'php/test_normal.php')
-rwxr-xr-xphp/test_normal.php19
1 files changed, 19 insertions, 0 deletions
diff --git a/php/test_normal.php b/php/test_normal.php
new file mode 100755
index 0000000..ee348c2
--- /dev/null
+++ b/php/test_normal.php
@@ -0,0 +1,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);
+?>
+