관리-도구
편집 파일: 007.phpt
--TEST-- Check for simple array serialization --SKIPIF-- --FILE-- <?php if(!extension_loaded('msgpack')) { dl('msgpack.' . PHP_SHLIB_SUFFIX); } function test($type, $variable) { $serialized = msgpack_serialize($variable); $unserialized = msgpack_unserialize($serialized); echo $type, PHP_EOL; echo bin2hex($serialized), PHP_EOL; var_dump($unserialized); echo $unserialized == $variable ? 'OK' : 'ERROR', PHP_EOL; } test('empty array:', array()); test('array(1, 2, 3)', array(1, 2, 3)); test('array(array(1, 2, 3), arr...', array(array(1, 2, 3), array(4, 5, 6), array(7, 8, 9))); ?> --EXPECT-- empty array: 90 array(0) { } OK array(1, 2, 3) 93010203 array(3) { [0]=> int(1) [1]=> int(2) [2]=> int(3) } OK array(array(1, 2, 3), arr... 93930102039304050693070809 array(3) { [0]=> array(3) { [0]=> int(1) [1]=> int(2) [2]=> int(3) } [1]=> array(3) { [0]=> int(4) [1]=> int(5) [2]=> int(6) } [2]=> array(3) { [0]=> int(7) [1]=> int(8) [2]=> int(9) } } OK